• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisión948001b54d6d630323f194b751ae085e2fe602a7 (tree)
Tiempo2022-05-24 10:07:23
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

The server now updates a spectator's lagging status to all clients and the mini lag icon on the scoreboard now shows for spectators.

Cambiar Resumen

Diferencia incremental

diff -r b0e911ab58ed -r 948001b54d6d src/scoreboard.cpp
--- a/src/scoreboard.cpp Mon May 23 08:44:24 2022 -0400
+++ b/src/scoreboard.cpp Mon May 23 21:07:23 2022 -0400
@@ -476,7 +476,7 @@
476476 }
477477
478478 // [AK] Also show an icon if the player is lagging to the server.
479- if (( players[ulPlayer].bLagging ) && ( players[ulPlayer].bSpectating == false ) && ( gamestate == GS_LEVEL ))
479+ if (( players[ulPlayer].bLagging ) && ( gamestate == GS_LEVEL ))
480480 scoreboard_DrawIcon( "LAGMINI", ulXPosOffset, g_ulCurYPos, 4 );
481481
482482 // Draw text if there's a vote on and this player voted.
diff -r b0e911ab58ed -r 948001b54d6d src/sv_main.cpp
--- a/src/sv_main.cpp Mon May 23 08:44:24 2022 -0400
+++ b/src/sv_main.cpp Mon May 23 21:07:23 2022 -0400
@@ -1072,19 +1072,20 @@
10721072 continue;
10731073 }
10741074
1075+ const int lastCommandTicDiff = gametic - g_aClients[ulIdx].ulLastCommandTic;
1076+
10751077 // If we haven't gotten a packet from this client in CLIENT_TIMEOUT seconds,
10761078 // disconnect him.
1077- if (( gametic - g_aClients[ulIdx].ulLastCommandTic ) >= ( CLIENT_TIMEOUT * TICRATE ))
1079+ if ( lastCommandTicDiff >= CLIENT_TIMEOUT * TICRATE )
10781080 {
10791081 SERVER_DisconnectClient( ulIdx, true, true );
10801082 continue;
10811083 }
10821084
1083- if ( players[ulIdx].bSpectating )
1084- continue;
1085-
10861085 // Also check to see if the client is lagging.
1087- if (( gametic - g_aClients[ulIdx].ulLastCommandTic ) >= TICRATE )
1086+ // [AK] Spectators don't send updates as often as in-game players do, so give
1087+ // them more time before marking them as lagging.
1088+ if ( lastCommandTicDiff >= ( players[ulIdx].bSpectating ? TICRATE * 5 : TICRATE ))
10881089 {
10891090 // Have not heard from the client in at least one second; mark him as
10901091 // lagging and tell clients.
Show on old repository browser