LCEMP commit: prepare code for dedicated server support

This commit is contained in:
2026-08-14 13:32:11 +03:00
parent 67a8111974
commit f404e4b4e4
13 changed files with 150 additions and 23 deletions
+7 -1
View File
@@ -116,7 +116,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason)
return;
}
app.DebugPrintf("PlayerConnection disconect reason: %d\n", reason );
app.DebugPrintf("PlayerConnection disconect reason: %d", reason );
player->disconnect();
// 4J Stu - Need to remove the player from the receiving list before their socket is NULLed so that we can find another player on their system
@@ -543,10 +543,16 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
if(getWasKicked())
{
server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) );
#ifdef _DEDICATED_SERVER
app.DebugPrintf("%ls was kicked from the game", player->name.c_str());
#endif
}
else
{
server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) );
#ifdef _DEDICATED_SERVER
app.DebugPrintf("%ls left the game", player->name.c_str());
#endif
}
server->getPlayers()->remove(player);
done = true;