Revision | a81bb124128c22b8bf7b99c5dc00af0d74ab99d9 (tree) |
---|---|
Time | 2022-02-07 00:38:24 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
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.
@@ -1,8 +1,7 @@ | ||
1 | 1 | Command SpawnPlayer |
2 | 2 | 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 | |
6 | 5 | Bool isBot |
7 | 6 | Bool isSpectating |
8 | 7 | Bool isDeadSpectator |
@@ -3516,7 +3516,7 @@ | ||
3516 | 3516 | |
3517 | 3517 | pPlayer->mo = pActor; |
3518 | 3518 | pActor->player = pPlayer; |
3519 | - pPlayer->playerstate = playerState; | |
3519 | + pPlayer->playerstate = PST_LIVE; | |
3520 | 3520 | |
3521 | 3521 | // If we were watching through this player's eyes, reattach the camera. |
3522 | 3522 | if ( bWasWatchingPlayer ) |
@@ -3631,7 +3631,6 @@ | ||
3631 | 3631 | pPlayer->camera = pCameraActor; |
3632 | 3632 | else |
3633 | 3633 | pPlayer->camera = pActor; |
3634 | - pPlayer->playerstate = PST_LIVE; | |
3635 | 3634 | pPlayer->refire = 0; |
3636 | 3635 | pPlayer->damagecount = 0; |
3637 | 3636 | pPlayer->bonuscount = 0; |
@@ -3696,8 +3695,6 @@ | ||
3696 | 3695 | pActor->z + TELEFOGHEIGHT, ALLOW_REPLACE ); |
3697 | 3696 | } |
3698 | 3697 | |
3699 | - pPlayer->playerstate = PST_LIVE; | |
3700 | - | |
3701 | 3698 | // [BB] If the player is reborn, we have to substitute all pointers |
3702 | 3699 | // to the old body to the new one. Otherwise (among other things) CLIENTSIDE |
3703 | 3700 | // ENTER scripts stop working after the corresponding player is respawned. |
@@ -263,8 +263,6 @@ | ||
263 | 263 | command.SetPlayer( &players[ulPlayer] ); |
264 | 264 | command.SetPriorState( lPlayerState ); |
265 | 265 | 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 ); | |
268 | 266 | command.SetIsSpectating( players[ulPlayer].bSpectating ); |
269 | 267 | command.SetIsDeadSpectator( players[ulPlayer].bDeadSpectator ); |
270 | 268 | command.SetIsMorphed( bMorph ); |