# HG changeset patch # User Adam Kaminski # Date 1630939253 14400 # Mon Sep 06 10:40:53 2021 -0400 # Node ID 3168d5e0a234bf75d1ad4381c2ddcfa507ce049d # Parent d006955f5d6c6bbb7590d6cd1cdc304733c31923 Changed the formatting of the SetPlayerDeaths server command, for cosmetic reasons. diff -r d006955f5d6c -r 3168d5e0a234 protocolspec/spec.players.txt --- a/protocolspec/spec.players.txt Mon Sep 06 10:31:40 2021 -0400 +++ b/protocolspec/spec.players.txt Mon Sep 06 10:40:53 2021 -0400 @@ -106,6 +106,12 @@ Variable wins EndCommand +Command SetPlayerDeaths + ExtendedCommand + Player player + Variable deaths +EndCommand + Command SetPlayerKillCount Player player Variable killCount diff -r d006955f5d6c -r 3168d5e0a234 src/cl_main.cpp --- a/src/cl_main.cpp Mon Sep 06 10:31:40 2021 -0400 +++ b/src/cl_main.cpp Mon Sep 06 10:40:53 2021 -0400 @@ -2127,18 +2127,6 @@ } break; - case SVC2_SETPLAYERDEATHS: - { - const ULONG ulPlayer = pByteStream->ReadByte(); - const int deaths = pByteStream->ReadVariable(); - - if ( PLAYER_IsValidPlayer( ulPlayer ) == false ) - break; - - players[ulPlayer].ulDeathCount = deaths; - } - break; - case SVC2_SRP_USER_START_AUTHENTICATION: case SVC2_SRP_USER_PROCESS_CHALLENGE: case SVC2_SRP_USER_VERIFY_SESSION: @@ -4209,6 +4197,14 @@ //***************************************************************************** // +void ServerCommands::SetPlayerDeaths::Execute() +{ + player->ulDeathCount = deaths; + HUD_Refresh( ); +} + +//***************************************************************************** +// void ServerCommands::SetPlayerKillCount::Execute() { player->killcount = killCount; diff -r d006955f5d6c -r 3168d5e0a234 src/sv_commands.cpp --- a/src/sv_commands.cpp Mon Sep 06 10:31:40 2021 -0400 +++ b/src/sv_commands.cpp Mon Sep 06 10:40:53 2021 -0400 @@ -611,9 +611,9 @@ if ( PLAYER_IsValidPlayer( ulPlayer ) == false ) return; - NetCommand command( SVC2_SETPLAYERDEATHS ); - command.addByte( ulPlayer ); - command.addVariable( players[ulPlayer].ulDeathCount ); + ServerCommands::SetPlayerDeaths command; + command.SetPlayer( &players[ulPlayer] ); + command.SetDeaths( players[ulPlayer].ulDeathCount ); command.sendCommandToClients( ulPlayerExtra, flags ); }