• 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 Beta for Mac Os (Silicon and Intel)


Commit MetaInfo

修订版983234fe42553bb6e26d3689a0fb9d11284c6072 (tree)
时间2022-01-29 08:43:29
作者Adam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed: the server rejected backup weapon select commands that used different weapon network indices but had the same client gametic.

更改概述

差异

diff -r eb8be61a2018 -r 983234fe4255 src/sv_main.cpp
--- a/src/sv_main.cpp Wed Jan 26 22:53:56 2022 -0500
+++ b/src/sv_main.cpp Fri Jan 28 18:43:29 2022 -0500
@@ -2029,6 +2029,7 @@
20292029 g_aClients[lClient].lLastPacketLossTick = 0;
20302030 g_aClients[lClient].lLastMoveTick = 0;
20312031 g_aClients[lClient].lLastMoveTickProcess = 0;
2032+ g_aClients[lClient].usLastWeaponNetworkIndex = 0;
20322033 g_aClients[lClient].lOverMovementLevel = 0;
20332034 g_aClients[lClient].bRunEnterScripts = false;
20342035 g_aClients[lClient].bSuspicious = false;
@@ -5222,8 +5223,13 @@
52225223 {
52235224 if ( recentCMDs->getOldestEntry( i ) == ulClientTic )
52245225 {
5225- delete cmd;
5226- return false;
5226+ // [AK] Non-move (i.e. weapon select) commands with the same client gametic but
5227+ // different weapon net ids are not duplicates, so don't delete them.
5228+ if (( bIsMoveCMD ) || ( cmd->getWeaponNetworkIndex( ) == g_aClients[g_lCurrentClient].usLastWeaponNetworkIndex ))
5229+ {
5230+ delete cmd;
5231+ return false;
5232+ }
52275233 }
52285234 }
52295235
@@ -5231,6 +5237,10 @@
52315237 recentCMDs->put( ulClientTic );
52325238 }
52335239
5240+ // [AK] Save the net id of the weapon sent last if this is a non-move (i.e. weapon select) command.
5241+ if ( bIsMoveCMD == false )
5242+ g_aClients[g_lCurrentClient].usLastWeaponNetworkIndex = cmd->getWeaponNetworkIndex( );
5243+
52345244 if ( sv_useticbuffer )
52355245 {
52365246 if ( ulClientTic != 0 )
diff -r eb8be61a2018 -r 983234fe4255 src/sv_main.h
--- a/src/sv_main.h Wed Jan 26 22:53:56 2022 -0500
+++ b/src/sv_main.h Fri Jan 28 18:43:29 2022 -0500
@@ -285,6 +285,11 @@
285285 {
286286 return 0;
287287 }
288+
289+ virtual unsigned short getWeaponNetworkIndex ( ) const
290+ {
291+ return 0;
292+ }
288293 };
289294
290295 //*****************************************************************************
@@ -307,6 +312,11 @@
307312 return moveCmd.ulGametic;
308313 }
309314
315+ virtual unsigned short getWeaponNetworkIndex ( ) const
316+ {
317+ return moveCmd.usWeaponNetworkIndex;
318+ }
319+
310320 void setClientTic( ULONG ulTic )
311321 {
312322 moveCmd.ulGametic = ulTic;
@@ -321,6 +331,11 @@
321331 ClientWeaponSelectCommand ( BYTESTREAM_s *pByteStream );
322332
323333 bool process ( const ULONG ulClient ) const;
334+
335+ virtual unsigned short getWeaponNetworkIndex ( ) const
336+ {
337+ return usActorNetworkIndex;
338+ }
324339 };
325340
326341 //*****************************************************************************
@@ -431,6 +446,9 @@
431446 // [AK] The last movement command we received from this client.
432447 ClientMoveCommand *LastMoveCMD;
433448
449+ // [AK] The network index the client sent with their last weapon select command.
450+ USHORT usLastWeaponNetworkIndex;
451+
434452 // We keep track of how many extra movement commands we get from the client. If it
435453 // exceeds a certain level over time, we kick him.
436454 LONG lOverMovementLevel;