Ticket #4315: 4315-lobby-kick-v1.patch
File 4315-lobby-kick-v1.patch, 2.3 KB (added by , 7 years ago) |
---|
-
binaries/data/mods/public/gui/credits/texts/programming.json
176 176 {"nick": "Sandarac"}, 177 177 {"nick": "sanderd17", "name": "Sander Deryckere"}, 178 178 {"nick": "sathyam", "name": "Sathyam Vellal"}, 179 {"nick": "sbirmi", "name": "Sharad Birmiwal"}, 179 180 {"nick": "sbte", "name": "Sven Baars"}, 180 181 {"nick": "scroogie", "name": "André Gemünd"}, 181 182 {"nick": "scythetwirler", "name": "Casey X."}, -
binaries/data/mods/public/gui/lobby/lobby.js
156 156 }), 157 157 "isSpecial": true 158 158 }); 159 // I am getting kicked 160 if (msg.text == g_Username) { 161 warn("Got disconnected from the lobby"); 162 returnToMainMenu(); 163 } 164 return {'kicked': true}; 159 165 }, 160 166 "presence": msg => { 161 167 }, … … 728 734 } 729 735 730 736 /** 737 * Parse the result of g_NetMessageTypes's response (if any). 738 * 739 * @param {Object} result - the response from netMessageResultAttr 740 * @param {string} attr - the attribute in the response 741 * @param {any} defaultValue - default value to return if attribute 742 * is not found in the response 743 */ 744 function netMessageResultAttr(result, attr, defaultValue) 745 { 746 if (result === undefined) 747 return defaultValue; 748 if (result.hasOwnProperty(attr)) 749 return result[attr]; 750 return defaultValue; 751 } 752 753 /** 731 754 * Processes GUI messages sent by the XmppClient. 732 755 */ 733 756 function onTick() … … 751 774 warn("Unrecognised message level: " + msg.level); 752 775 continue; 753 776 } 754 g_NetMessageTypes[msg.type][msg.level](msg);777 let result = g_NetMessageTypes[msg.type][msg.level](msg); 755 778 756 779 // To improve performance, only update the playerlist GUI when 757 780 // the last update in the current stack is processed 758 if (msg.type == "chat" && Engine.LobbyGetMucMessageCount() == 0) 781 if (msg.type == "chat" && Engine.LobbyGetMucMessageCount() == 0 && 782 netMessageResultAttr(result, "kicked", false) == false) 759 783 updatePlayerList(); 760 784 } 761 785 }