mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Store starttic as a raw value in PT_SERVERTICS packets
This avoids some desynch issues and is simpler to handle. Those packets are always big anyway, so the difference is irrelevant.
This commit is contained in:
parent
b6251c1088
commit
24bd03cd22
3 changed files with 4 additions and 4 deletions
|
|
@ -4252,7 +4252,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
realstart = ExpandTics(netbuffer->u.serverpak.starttic);
|
realstart = netbuffer->u.serverpak.starttic;
|
||||||
realend = realstart + netbuffer->u.serverpak.numtics;
|
realend = realstart + netbuffer->u.serverpak.numtics;
|
||||||
|
|
||||||
if (!txtpak)
|
if (!txtpak)
|
||||||
|
|
@ -4659,7 +4659,7 @@ static void SV_SendTics(void)
|
||||||
|
|
||||||
// Send the tics
|
// Send the tics
|
||||||
netbuffer->packettype = PT_SERVERTICS;
|
netbuffer->packettype = PT_SERVERTICS;
|
||||||
netbuffer->u.serverpak.starttic = (UINT8)realfirsttic;
|
netbuffer->u.serverpak.starttic = realfirsttic;
|
||||||
netbuffer->u.serverpak.numtics = (UINT8)(lasttictosend - realfirsttic);
|
netbuffer->u.serverpak.numtics = (UINT8)(lasttictosend - realfirsttic);
|
||||||
netbuffer->u.serverpak.numslots = (UINT8)SHORT(doomcom->numslots);
|
netbuffer->u.serverpak.numslots = (UINT8)SHORT(doomcom->numslots);
|
||||||
bufpos = (UINT8 *)&netbuffer->u.serverpak.cmds;
|
bufpos = (UINT8 *)&netbuffer->u.serverpak.cmds;
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ typedef struct
|
||||||
// this packet is too large
|
// this packet is too large
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 starttic;
|
tic_t starttic;
|
||||||
UINT8 numtics;
|
UINT8 numtics;
|
||||||
UINT8 numslots; // "Slots filled": Highest player number in use plus one.
|
UINT8 numslots; // "Slots filled": Highest player number in use plus one.
|
||||||
ticcmd_t cmds[45]; // Normally [BACKUPTIC][MAXPLAYERS] but too large
|
ticcmd_t cmds[45]; // Normally [BACKUPTIC][MAXPLAYERS] but too large
|
||||||
|
|
|
||||||
|
|
@ -838,7 +838,7 @@ static void DebugPrintpacket(const char *header)
|
||||||
size_t ntxtcmd = &((UINT8 *)netbuffer)[doomcom->datalength] - cmd;
|
size_t ntxtcmd = &((UINT8 *)netbuffer)[doomcom->datalength] - cmd;
|
||||||
|
|
||||||
fprintf(debugfile, " firsttic %u ply %d tics %d ntxtcmd %s\n ",
|
fprintf(debugfile, " firsttic %u ply %d tics %d ntxtcmd %s\n ",
|
||||||
(UINT32)ExpandTics(serverpak->starttic), serverpak->numslots, serverpak->numtics, sizeu1(ntxtcmd));
|
(UINT32)serverpak->starttic, serverpak->numslots, serverpak->numtics, sizeu1(ntxtcmd));
|
||||||
/// \todo Display more readable information about net commands
|
/// \todo Display more readable information about net commands
|
||||||
fprintfstringnewline((char *)cmd, ntxtcmd);
|
fprintfstringnewline((char *)cmd, ntxtcmd);
|
||||||
/*fprintfstring((char *)cmd, 3);
|
/*fprintfstring((char *)cmd, 3);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue