• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisiona81bb124128c22b8bf7b99c5dc00af0d74ab99d9 (tree)
Time2022-02-07 00:38:24
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

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.

Change Summary

Incremental Difference

diff -r e59a7ded15c3 -r a81bb124128c 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 @@
11 Command SpawnPlayer
22 Player player with IndexTestOnly
3- Byte priorState
4- # Do we really need to send this? Shouldn't it always be PST_LIVE?
5- Byte playerState
3+ # [AK] Send the prior state as a short byte so that the four bools can fit together into a single byte.
4+ ShortByte<4> priorState
65 Bool isBot
76 Bool isSpectating
87 Bool isDeadSpectator
diff -r e59a7ded15c3 -r a81bb124128c 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 @@
35163516
35173517 pPlayer->mo = pActor;
35183518 pActor->player = pPlayer;
3519- pPlayer->playerstate = playerState;
3519+ pPlayer->playerstate = PST_LIVE;
35203520
35213521 // If we were watching through this player's eyes, reattach the camera.
35223522 if ( bWasWatchingPlayer )
@@ -3631,7 +3631,6 @@
36313631 pPlayer->camera = pCameraActor;
36323632 else
36333633 pPlayer->camera = pActor;
3634- pPlayer->playerstate = PST_LIVE;
36353634 pPlayer->refire = 0;
36363635 pPlayer->damagecount = 0;
36373636 pPlayer->bonuscount = 0;
@@ -3696,8 +3695,6 @@
36963695 pActor->z + TELEFOGHEIGHT, ALLOW_REPLACE );
36973696 }
36983697
3699- pPlayer->playerstate = PST_LIVE;
3700-
37013698 // [BB] If the player is reborn, we have to substitute all pointers
37023699 // to the old body to the new one. Otherwise (among other things) CLIENTSIDE
37033700 // ENTER scripts stop working after the corresponding player is respawned.
diff -r e59a7ded15c3 -r a81bb124128c 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 @@
263263 command.SetPlayer( &players[ulPlayer] );
264264 command.SetPriorState( lPlayerState );
265265 command.SetIsBot( players[ulPlayer].bIsBot );
266- // Do we really need to send this? Shouldn't it always be PST_LIVE?
267- command.SetPlayerState( players[ulPlayer].playerstate );
268266 command.SetIsSpectating( players[ulPlayer].bSpectating );
269267 command.SetIsDeadSpectator( players[ulPlayer].bDeadSpectator );
270268 command.SetIsMorphed( bMorph );
Show on old repository browser