Ticket #3604: t3604_stop_rejoin_confusion_v4.patch
File t3604_stop_rejoin_confusion_v4.patch, 4.1 KB (added by , 8 years ago) |
---|
-
binaries/data/config/default.cfg
server = "lobby.wildfiregames.com" ; Ad 347 347 xpartamupp = "wfgbot20" ; Name of the server-side xmpp client that manage games 348 348 349 349 [mod] 350 350 enabledmods = "mod public" 351 351 352 [network] 353 prohibitIdenticalPlayernames = true ; Disable joins as "User (2)" in case someone with the name "User" is already connected 354 352 355 [overlay] 353 356 fps = "false" ; Show frames per second in top right corner 354 357 realtime = "false" ; Show current system time in top right corner 355 358 netwarnings = "true" ; Show warnings if the network connection is bad 356 359 -
binaries/data/mods/public/gui/common/network.js
function getDisconnectReason(id) 55 55 case 2: return translate("Incorrect network protocol version"); 56 56 case 3: return translate("Game is loading, please try later"); 57 57 case 4: return translate("Game has already started, no observers allowed"); 58 58 case 5: return translate("You have been kicked"); 59 59 case 6: return translate("You have been banned"); 60 case 7: return translate("Playername in use. If you were disconnected, retry in few seconds"); 60 61 default: 61 62 warn("Unknown disconnect-reason ID received: " + id); 62 63 return sprintf(translate("\\[Invalid value %(id)s]"), { "id": id }); 63 64 } 64 65 } -
source/network/NetHost.h
enum NetDisconnectReason 63 63 NDR_SERVER_SHUTDOWN, 64 64 NDR_INCORRECT_PROTOCOL_VERSION, 65 65 NDR_SERVER_LOADING, 66 66 NDR_SERVER_ALREADY_IN_GAME, 67 67 NDR_KICKED, 68 NDR_BANNED 68 NDR_BANNED, 69 NDR_PLAYERNAME_IN_USE 69 70 }; 70 71 71 72 class CNetHost 72 73 { 73 74 public: -
source/network/NetMessages.h
26 26 #include "ps/CStr.h" 27 27 #include "scriptinterface/ScriptVal.h" 28 28 29 29 #define PS_PROTOCOL_MAGIC 0x5073013f // 'P', 's', 0x01, '?' 30 30 #define PS_PROTOCOL_MAGIC_RESPONSE 0x50630121 // 'P', 'c', 0x01, '!' 31 #define PS_PROTOCOL_VERSION 0x010100 09// Arbitrary protocol31 #define PS_PROTOCOL_VERSION 0x01010010 // Arbitrary protocol 32 32 #define PS_DEFAULT_PORT 0x5073 // 'P', 's' 33 33 34 34 // Defines the list of message types. The order of the list must not change. 35 35 // The message types having a negative value are used internally and not sent 36 36 // over the network. The message types used for network communication have -
source/network/NetServer.cpp
bool CNetServerWorker::OnAuthenticate(vo 899 899 session->Disconnect(NDR_SERVER_LOADING); 900 900 return true; 901 901 } 902 902 903 903 CAuthenticateMessage* message = (CAuthenticateMessage*)event->GetParamRef(); 904 CStrW username = server.DeduplicatePlayerName(SanitisePlayerName(message->m_Name)); 904 CStrW username = SanitisePlayerName(message->m_Name); 905 906 // Check for duplicate names 907 bool prohibitIdenticalPlayernames = false; 908 CFG_GET_VAL("network.prohibitIdenticalPlayernames", prohibitIdenticalPlayernames); 909 if (!prohibitIdenticalPlayernames) 910 username = server.DeduplicatePlayerName(username); 911 else if (std::find_if( 912 server.m_Sessions.begin(), server.m_Sessions.end(), 913 [&username] (const CNetServerSession* session) 914 { return session->GetUserName() == username; }) 915 != server.m_Sessions.end()) 916 { 917 session->Disconnect(NDR_PLAYERNAME_IN_USE); 918 return true; 919 } 905 920 906 921 // Disconnect banned usernames 907 922 if (std::find(server.m_BannedPlayers.begin(), server.m_BannedPlayers.end(), username) != server.m_BannedPlayers.end()) 908 923 { 909 924 session->Disconnect(NDR_BANNED);