prepare code for dedicated server support

This commit is contained in:
NOTPIES
2026-03-08 22:13:19 -03:00
parent 6b89993c04
commit 00f6df9605
14 changed files with 161 additions and 23 deletions

View File

@@ -118,7 +118,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason)
return;
}
app.DebugPrintf("PlayerConnection disconect reason: %d\n", reason );
app.DebugPrintf("PlayerConnection disconnect 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
@@ -130,10 +130,16 @@ void PlayerConnection::disconnect(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);