MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Disconnect

Method Disconnect

engine/Poseidon/Network/NetworkClientActions.cpp:1145–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143 NetworkCommandMessage msg;
1144 msg.type = NCMTUnban;
1145 msg.content.WriteString(idOrIp);
1146 SendMsg(&msg, NMFGuaranteed);
1147}
1148
1149void NetworkClient::Disconnect(RString message)
1150{
1151 LOG_DEBUG(Network, "[disconnect] NetworkClient::Disconnect: msg='{}' serverState={} state={}", (const char*)message,
1152 (int)_serverState, (int)_state);
1153 RemoveUserMessages();
1154
1155 _state = NGSNone;
1156 _serverState = NGSNone;
1157
1158 // Leaving the server: difficulty reverts to the local profile.
1159 USER_CONFIG.ClearServerDifficulty();
1160
1161 const PlayerIdentity* id = FindIdentity(_player);
1162 if (id)
1163 {
1164 RString senderName = id->name;
1165 GChatList.Add(CCGlobal, senderName, message, false, true);

Callers

nothing calls this directly

Calls 3

FindIdentityFunction · 0.85
AddMethod · 0.45
ChatMethod · 0.45

Tested by

no test coverage detected