# HG changeset patch # User Adam Kaminski # Date 1644161904 18000 # Sun Feb 06 10:38:24 2022 -0500 # Node ID 93cf8bf8e48feb0a3106742a4803ad4d24e24867 # Parent e59a7ded15c3f37cb5ad52118ca6a9c1ab132d2e The "SpawnPlayer" server command doesn't send the player's current state anymore, and their prior state is now sent as a short byte to reduce bandwidth slightly. diff -r e59a7ded15c3 -r 93cf8bf8e48f protocolspec/spec.players.txt --- a/protocolspec/spec.players.txt Thu Feb 03 20:14:02 2022 -0500 +++ b/protocolspec/spec.players.txt Sun Feb 06 10:38:24 2022 -0500 @@ -1,8 +1,7 @@ Command SpawnPlayer Player player with IndexTestOnly - Byte priorState - # Do we really need to send this? Shouldn't it always be PST_LIVE? - Byte playerState + # [AK] Send the prior state as a short byte so that the four bools can fit together into a single byte. + ShortByte<4> priorState Bool isBot Bool isSpectating Bool isDeadSpectator diff -r e59a7ded15c3 -r 93cf8bf8e48f src/cl_main.cpp --- a/src/cl_main.cpp Thu Feb 03 20:14:02 2022 -0500 +++ b/src/cl_main.cpp Sun Feb 06 10:38:24 2022 -0500 @@ -3516,7 +3516,7 @@ pPlayer->mo = pActor; pActor->player = pPlayer; - pPlayer->playerstate = playerState; + pPlayer->playerstate = PST_LIVE; // If we were watching through this player's eyes, reattach the camera. if ( bWasWatchingPlayer ) @@ -3631,7 +3631,6 @@ pPlayer->camera = pCameraActor; else pPlayer->camera = pActor; - pPlayer->playerstate = PST_LIVE; pPlayer->refire = 0; pPlayer->damagecount = 0; pPlayer->bonuscount = 0; @@ -3696,8 +3695,6 @@ pActor->z + TELEFOGHEIGHT, ALLOW_REPLACE ); } - pPlayer->playerstate = PST_LIVE; - // [BB] If the player is reborn, we have to substitute all pointers // to the old body to the new one. Otherwise (among other things) CLIENTSIDE // ENTER scripts stop working after the corresponding player is respawned. diff -r e59a7ded15c3 -r 93cf8bf8e48f src/sv_commands.cpp --- a/src/sv_commands.cpp Thu Feb 03 20:14:02 2022 -0500 +++ b/src/sv_commands.cpp Sun Feb 06 10:38:24 2022 -0500 @@ -263,8 +263,6 @@ command.SetPlayer( &players[ulPlayer] ); command.SetPriorState( lPlayerState ); command.SetIsBot( players[ulPlayer].bIsBot ); - // Do we really need to send this? Shouldn't it always be PST_LIVE? - command.SetPlayerState( players[ulPlayer].playerstate ); command.SetIsSpectating( players[ulPlayer].bSpectating ); command.SetIsDeadSpectator( players[ulPlayer].bDeadSpectator ); command.SetIsMorphed( bMorph );