This is a fork of Zandronum Beta for Mac Os (Silicon and Intel)
修訂 | be78ea8458798218f87a8efd4bf1b249385a6b60 (tree) |
---|---|
時間 | 2022-10-11 22:37:09 |
作者 | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Fixed: Every client's ping would be stuck at zero on a Linux server that was running for more than 24 consecutive days.
@@ -84,6 +84,7 @@ | ||
84 | 84 | - - Fixed: cl_medals also affected the server and could prevent players from earning any medals if disabled. [Kaminsky] |
85 | 85 | - - Fixed: the server didn't always update the correct flagset (e.g. dmflags, compatflags, lmsspectatorsettings) to the clients. [Kaminsky] |
86 | 86 | - - Fixed: the server would still print which flags have changed for lmsallowedweapons when the current game mode wasn't (T)LMS. [Kaminsky] |
87 | +- - Fixed: Every client's ping would be stuck at zero on a Linux server that was running for more than 24 consecutive days. [Kaminsky] | |
87 | 88 | ! - The result value of GAMEEVENT_MEDALS event scripts can now be used to determine whether or not the player receives the medal. [Kaminsky] |
88 | 89 | ! - GAMEMODE flags are now validated after all GAMEMODE lumps have been parsed instead of after each one. The internal game mode name (e.g. "TeamLMS") is now printed with the error message instead of the actual name. [Kaminsky] |
89 | 90 | ! - Added an extra check to ensure that game modes have a (short) name. [Kaminsky] |
@@ -475,7 +475,7 @@ | ||
475 | 475 | |
476 | 476 | //***************************************************************************** |
477 | 477 | // |
478 | -void CLIENTCOMMANDS_Pong( ULONG ulTime ) | |
478 | +void CLIENTCOMMANDS_Pong( unsigned int time ) | |
479 | 479 | { |
480 | 480 | // [BB] CLIENTCOMMANDS_Pong is the only client command function that |
481 | 481 | // immediately launches a network packet. This is something that |
@@ -490,7 +490,7 @@ | ||
490 | 490 | TempBuffer.Init( MAX_UDP_PACKET, BUFFERTYPE_WRITE ); |
491 | 491 | TempBuffer.Clear(); |
492 | 492 | TempBuffer.ByteStream.WriteByte( CLC_PONG ); |
493 | - TempBuffer.ByteStream.WriteLong( ulTime ); | |
493 | + TempBuffer.ByteStream.WriteLong( time ); | |
494 | 494 | NETWORK_LaunchPacket( &TempBuffer, NETWORK_GetFromAddress( ) ); |
495 | 495 | TempBuffer.Free(); |
496 | 496 | } |
@@ -82,7 +82,7 @@ | ||
82 | 82 | void CLIENTCOMMANDS_Ignore( ULONG ulPlayer, bool bIgnore, LONG lTicks = -1 ); |
83 | 83 | void CLIENTCOMMANDS_ClientMove( void ); |
84 | 84 | void CLIENTCOMMANDS_MissingPacket( void ); |
85 | -void CLIENTCOMMANDS_Pong( ULONG ulTime ); | |
85 | +void CLIENTCOMMANDS_Pong( unsigned int time ); | |
86 | 86 | void CLIENTCOMMANDS_WeaponSelect( const PClass *pType ); |
87 | 87 | void CLIENTCOMMANDS_SendBackupWeaponSelect( void ); |
88 | 88 | void CLIENTCOMMANDS_Taunt( void ); |
@@ -212,10 +212,10 @@ | ||
212 | 212 | |
213 | 213 | //***************************************************************************** |
214 | 214 | // |
215 | -void SERVERCOMMANDS_Ping( ULONG ulTime ) | |
215 | +void SERVERCOMMANDS_Ping( unsigned int time ) | |
216 | 216 | { |
217 | 217 | ServerCommands::Ping command; |
218 | - command.SetTime( ulTime ); | |
218 | + command.SetTime( time ); | |
219 | 219 | command.sendCommandToClients(); |
220 | 220 | } |
221 | 221 |
@@ -82,7 +82,7 @@ | ||
82 | 82 | // PROTOTYPES |
83 | 83 | |
84 | 84 | // General protocol commands. These handle connecting to and being part of the server. |
85 | -void SERVERCOMMANDS_Ping( ULONG ulTime ); | |
85 | +void SERVERCOMMANDS_Ping( unsigned int time ); | |
86 | 86 | void SERVERCOMMANDS_Nothing( ULONG ulPlayer, bool bReliable = false ); |
87 | 87 | void SERVERCOMMANDS_BeginSnapshot( ULONG ulPlayer ); |
88 | 88 | void SERVERCOMMANDS_EndSnapshot( ULONG ulPlayer ); |
@@ -6145,16 +6145,14 @@ | ||
6145 | 6145 | // |
6146 | 6146 | static bool server_UpdateClientPing( BYTESTREAM_s *pByteStream ) |
6147 | 6147 | { |
6148 | - ULONG ulPing; | |
6149 | - | |
6150 | - ulPing = pByteStream->ReadLong(); | |
6151 | - | |
6148 | + const unsigned int oldTime = pByteStream->ReadLong( ); | |
6152 | 6149 | const unsigned int nowTime = I_MSTime( ); |
6150 | + | |
6153 | 6151 | // [BB] This ping information from the client doesn't make sense. |
6154 | - if ( ulPing > nowTime ) | |
6152 | + if ( oldTime > nowTime ) | |
6155 | 6153 | return false; |
6156 | 6154 | |
6157 | - ULONG currentPing = (nowTime - ulPing); | |
6155 | + ULONG currentPing = nowTime - oldTime; | |
6158 | 6156 | const ULONG ticLength = 1000 / TICRATE; |
6159 | 6157 | player_t *p = &players[g_lCurrentClient]; |
6160 | 6158 | // [BB] Lag spike, reset the averaging. |