• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG), Euroboros (EB), and Down Under Doomers (DUD).


Commit MetaInfo

修订版be78ea8458798218f87a8efd4bf1b249385a6b60 (tree)
时间2022-10-11 22:37:09
作者Adam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed: Every client's ping would be stuck at zero on a Linux server that was running for more than 24 consecutive days.

更改概述

差异

diff -r 6cbfdc124b05 -r be78ea845879 docs/zandronum-history.txt
--- a/docs/zandronum-history.txt Sun Oct 09 16:35:32 2022 -0400
+++ b/docs/zandronum-history.txt Tue Oct 11 09:37:09 2022 -0400
@@ -84,6 +84,7 @@
8484 - - Fixed: cl_medals also affected the server and could prevent players from earning any medals if disabled. [Kaminsky]
8585 - - Fixed: the server didn't always update the correct flagset (e.g. dmflags, compatflags, lmsspectatorsettings) to the clients. [Kaminsky]
8686 - - 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]
8788 ! - The result value of GAMEEVENT_MEDALS event scripts can now be used to determine whether or not the player receives the medal. [Kaminsky]
8889 ! - 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]
8990 ! - Added an extra check to ensure that game modes have a (short) name. [Kaminsky]
diff -r 6cbfdc124b05 -r be78ea845879 src/cl_commands.cpp
--- a/src/cl_commands.cpp Sun Oct 09 16:35:32 2022 -0400
+++ b/src/cl_commands.cpp Tue Oct 11 09:37:09 2022 -0400
@@ -475,7 +475,7 @@
475475
476476 //*****************************************************************************
477477 //
478-void CLIENTCOMMANDS_Pong( ULONG ulTime )
478+void CLIENTCOMMANDS_Pong( unsigned int time )
479479 {
480480 // [BB] CLIENTCOMMANDS_Pong is the only client command function that
481481 // immediately launches a network packet. This is something that
@@ -490,7 +490,7 @@
490490 TempBuffer.Init( MAX_UDP_PACKET, BUFFERTYPE_WRITE );
491491 TempBuffer.Clear();
492492 TempBuffer.ByteStream.WriteByte( CLC_PONG );
493- TempBuffer.ByteStream.WriteLong( ulTime );
493+ TempBuffer.ByteStream.WriteLong( time );
494494 NETWORK_LaunchPacket( &TempBuffer, NETWORK_GetFromAddress( ) );
495495 TempBuffer.Free();
496496 }
diff -r 6cbfdc124b05 -r be78ea845879 src/cl_commands.h
--- a/src/cl_commands.h Sun Oct 09 16:35:32 2022 -0400
+++ b/src/cl_commands.h Tue Oct 11 09:37:09 2022 -0400
@@ -82,7 +82,7 @@
8282 void CLIENTCOMMANDS_Ignore( ULONG ulPlayer, bool bIgnore, LONG lTicks = -1 );
8383 void CLIENTCOMMANDS_ClientMove( void );
8484 void CLIENTCOMMANDS_MissingPacket( void );
85-void CLIENTCOMMANDS_Pong( ULONG ulTime );
85+void CLIENTCOMMANDS_Pong( unsigned int time );
8686 void CLIENTCOMMANDS_WeaponSelect( const PClass *pType );
8787 void CLIENTCOMMANDS_SendBackupWeaponSelect( void );
8888 void CLIENTCOMMANDS_Taunt( void );
diff -r 6cbfdc124b05 -r be78ea845879 src/sv_commands.cpp
--- a/src/sv_commands.cpp Sun Oct 09 16:35:32 2022 -0400
+++ b/src/sv_commands.cpp Tue Oct 11 09:37:09 2022 -0400
@@ -212,10 +212,10 @@
212212
213213 //*****************************************************************************
214214 //
215-void SERVERCOMMANDS_Ping( ULONG ulTime )
215+void SERVERCOMMANDS_Ping( unsigned int time )
216216 {
217217 ServerCommands::Ping command;
218- command.SetTime( ulTime );
218+ command.SetTime( time );
219219 command.sendCommandToClients();
220220 }
221221
diff -r 6cbfdc124b05 -r be78ea845879 src/sv_commands.h
--- a/src/sv_commands.h Sun Oct 09 16:35:32 2022 -0400
+++ b/src/sv_commands.h Tue Oct 11 09:37:09 2022 -0400
@@ -82,7 +82,7 @@
8282 // PROTOTYPES
8383
8484 // 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 );
8686 void SERVERCOMMANDS_Nothing( ULONG ulPlayer, bool bReliable = false );
8787 void SERVERCOMMANDS_BeginSnapshot( ULONG ulPlayer );
8888 void SERVERCOMMANDS_EndSnapshot( ULONG ulPlayer );
diff -r 6cbfdc124b05 -r be78ea845879 src/sv_main.cpp
--- a/src/sv_main.cpp Sun Oct 09 16:35:32 2022 -0400
+++ b/src/sv_main.cpp Tue Oct 11 09:37:09 2022 -0400
@@ -6145,16 +6145,14 @@
61456145 //
61466146 static bool server_UpdateClientPing( BYTESTREAM_s *pByteStream )
61476147 {
6148- ULONG ulPing;
6149-
6150- ulPing = pByteStream->ReadLong();
6151-
6148+ const unsigned int oldTime = pByteStream->ReadLong( );
61526149 const unsigned int nowTime = I_MSTime( );
6150+
61536151 // [BB] This ping information from the client doesn't make sense.
6154- if ( ulPing > nowTime )
6152+ if ( oldTime > nowTime )
61556153 return false;
61566154
6157- ULONG currentPing = (nowTime - ulPing);
6155+ ULONG currentPing = nowTime - oldTime;
61586156 const ULONG ticLength = 1000 / TICRATE;
61596157 player_t *p = &players[g_lCurrentClient];
61606158 // [BB] Lag spike, reset the averaging.