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:
Louis-Antoine 2020-05-17 20:09:11 +02:00
parent c05d1dd979
commit fc07db26c0
3 changed files with 4 additions and 4 deletions

View file

@ -4252,7 +4252,7 @@ static void HandlePacketFromPlayer(SINT8 node)
break;
}
realstart = ExpandTics(netbuffer->u.serverpak.starttic);
realstart = netbuffer->u.serverpak.starttic;
realend = realstart + netbuffer->u.serverpak.numtics;
if (!txtpak)
@ -4659,7 +4659,7 @@ static void SV_SendTics(void)
// Send the tics
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.numslots = (UINT8)SHORT(doomcom->numslots);
bufpos = (UINT8 *)&netbuffer->u.serverpak.cmds;

View file

@ -128,7 +128,7 @@ typedef struct
// this packet is too large
typedef struct
{
UINT8 starttic;
tic_t starttic;
UINT8 numtics;
UINT8 numslots; // "Slots filled": Highest player number in use plus one.
ticcmd_t cmds[45]; // Normally [BACKUPTIC][MAXPLAYERS] but too large

View file

@ -838,7 +838,7 @@ static void DebugPrintpacket(const char *header)
size_t ntxtcmd = &((UINT8 *)netbuffer)[doomcom->datalength] - cmd;
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
fprintfstringnewline((char *)cmd, ntxtcmd);
/*fprintfstring((char *)cmd, 3);