• R/O
  • SSH

Commit

Tags
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 TSPG.


Commit MetaInfo

Revisión2545939214ad0a8259a89655445869697be3e505 (tree)
Tiempo2021-11-28 01:14:22
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed lagging clients still feeling jittery on their ends due to the skip correction.

Cambiar Resumen

Diferencia incremental

diff -r fecc8025b0d3 -r 2545939214ad src/sv_main.cpp
--- a/src/sv_main.cpp Sat Nov 27 11:07:16 2021 -0500
+++ b/src/sv_main.cpp Sat Nov 27 11:14:22 2021 -0500
@@ -178,6 +178,7 @@
178178 static void server_PrintWithIP( FString message, const NETADDRESS_s &address );
179179 static void server_PerformBacktrace( ULONG ulClient );
180180 static bool server_ShouldPerformBacktrace( ULONG ulClient );
181+static void server_FixZFromBacktrace( APlayerPawn *pmo, fixed_t oldFloorZ );
181182
182183 // [RC]
183184 #ifdef CREATE_PACKET_LOG
@@ -7601,6 +7602,7 @@
76017602 {
76027603 ULONG ulExtrapolateStartTic = pClient->LastMoveCMD->getClientTic( );
76037604 ULONG ulNumExtrapolatedTics = pClient->ulExtrapolatedTics;
7605+ fixed_t oldFloorZ = 0;
76047606
76057607 pClient->bIsBacktracing = true;
76067608 pClient->ulExtrapolatedTics = 0;
@@ -7633,6 +7635,13 @@
76337635
76347636 pClient->LastMoveCMD->process( ulClient );
76357637
7638+ // [AK] Now we have to tick this player's body and set the proper psprite settings.
7639+ pmo->Tick( );
7640+ P_NewPspriteTick( &players[ulClient] );
7641+
7642+ pClient->lLastMoveTickProcess--;
7643+ oldFloorZ = pmo->floorz;
7644+
76367645 // [AK] Adjust the sector ceiling/floor heights for the next tic that we extrapolated the player.
76377646 // We don't have to do this on the last tic that we extrapolated the player.
76387647 if ( ulTic < ulNumExtrapolatedTics )
@@ -7644,11 +7653,12 @@
76447653 sectors[i].floorplane.d = sectors[i].floorplane.unlaggedD[unlaggedIndex];
76457654 sectors[i].ceilingplane.d = sectors[i].ceilingplane.unlaggedD[unlaggedIndex];
76467655 }
7656+
7657+ // [AK] Make sure the player doesn't get stuck in the floor/ceiling in case they moved.
7658+ server_FixZFromBacktrace( pmo, oldFloorZ );
76477659 }
76487660 }
76497661
7650- sector_t *pSector = pmo->Sector;
7651-
76527662 // [AK] Restore the sector ceiling/floor heights back to what they were before the backtrace.
76537663 for ( int i = 0; i < numsectors; i++ )
76547664 {
@@ -7658,15 +7668,7 @@
76587668
76597669 // [AK] As a final measure, fix the player's floorz/ceilingz and to ensure that they don't
76607670 // get stuck in the floor/ceiling of whatever sector they're supposed to be in.
7661- pmo->floorz = pSector->floorplane.ZatPoint( pmo->x, pmo->y );
7662- pmo->ceilingz = pSector->ceilingplane.ZatPoint( pmo->x, pmo->y );
7663- P_FindFloorCeiling( pmo, false );
7664-
7665- if ( pmo->z + pmo->height > pmo->ceilingz )
7666- pmo->z = pmo->ceilingz - pmo->height;
7667-
7668- if ( pmo->z < pmo->floorz )
7669- pmo->z = pmo->floorz;
7671+ server_FixZFromBacktrace( pmo, oldFloorZ );
76707672
76717673 pmo->velx += pClient->backtraceThrust[0];
76727674 pmo->vely += pClient->backtraceThrust[1];
@@ -7731,6 +7733,40 @@
77317733
77327734 //*****************************************************************************
77337735 //
7736+static void server_FixZFromBacktrace( APlayerPawn *pmo, fixed_t oldFloorZ )
7737+{
7738+ pmo->floorz = pmo->Sector->floorplane.ZatPoint( pmo->x, pmo->y );
7739+ pmo->ceilingz = pmo->Sector->ceilingplane.ZatPoint( pmo->x, pmo->y );
7740+ P_FindFloorCeiling( pmo, false );
7741+
7742+ if ( pmo->z + pmo->height > pmo->ceilingz )
7743+ pmo->z = pmo->ceilingz - pmo->height;
7744+
7745+ if ( pmo->z < pmo->floorz )
7746+ {
7747+ pmo->z = pmo->floorz;
7748+ }
7749+ else
7750+ {
7751+ // [AK] Check if the player should move with the floor if it moved, similarly to PIT_FloorDrop.
7752+ if (( pmo->velz == 0 ) && (!( pmo->flags & MF_NOGRAVITY ) || ( pmo->z == oldFloorZ && !( pmo->flags & MF_NOLIFTDROP ))))
7753+ {
7754+ if (( pmo->flags & MF_NOGRAVITY) || ( pmo->flags5 & MF5_MOVEWITHSECTOR ) ||
7755+ ( pmo->Sector->Flags & SECF_FLOORDROP ) || ( pmo->z - pmo->floorz <= 9 * FRACUNIT ))
7756+ {
7757+ pmo->z = pmo->floorz;
7758+ }
7759+ }
7760+ else if ( pmo->z != oldFloorZ && !( pmo->flags & MF_NOLIFTDROP ))
7761+ {
7762+ if (( pmo->flags & MF_NOGRAVITY ) && ( pmo->flags6 & MF6_RELATIVETOFLOOR ))
7763+ pmo->z = pmo->z - oldFloorZ + pmo->floorz;
7764+ }
7765+ }
7766+}
7767+
7768+//*****************************************************************************
7769+//
77347770 FString CLIENT_s::GetAccountName() const
77357771 {
77367772 if ( loggedIn )