Remove CLIENTMIS

based on this commit from SRB2Classic 5d977d4297
This commit is contained in:
NepDisk 2025-12-24 12:22:59 -05:00
parent 8da7bc7298
commit ba2b525172
3 changed files with 11 additions and 48 deletions

View file

@ -162,7 +162,6 @@ static char adminsalt[MAXNETNODES][9];
// Client specific
static ticcmd_t localcmds[MAXSPLITSCREENPLAYERS][MAXGENTLEMENDELAY];
static boolean cl_packetmissed;
// here it is for the secondary local player (splitscreen)
static UINT8 mynode; // my address pointofview server
static boolean cl_redownloadinggamestate = false;
@ -3629,7 +3628,6 @@ void SV_ResetServer(void)
memset(player_name_changes, 0, sizeof player_name_changes);
mynode = 0;
cl_packetmissed = false;
cl_redownloadinggamestate = false;
if (dedicated)
@ -4710,13 +4708,6 @@ static void PT_ClientCmd(SINT8 node, INT32 netconsole)
realstart = ExpandTics(netbuffer->u.clientpak.client_tic, nettics[node]);
realend = ExpandTics(netbuffer->u.clientpak.resendfrom, nettics[node]);
if (netbuffer->packettype == PT_CLIENTMIS || netbuffer->packettype == PT_CLIENT2MIS
|| netbuffer->packettype == PT_CLIENT3MIS || netbuffer->packettype == PT_CLIENT4MIS
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS
|| supposedtics[node] < realend)
{
supposedtics[node] = realend;
}
// Discard out of order packet
if (nettics[node] > realend)
{
@ -4737,8 +4728,7 @@ static void PT_ClientCmd(SINT8 node, INT32 netconsole)
// Don't do anything for packets of type NODEKEEPALIVE?
// Sryder 2018/07/01: Update the freezetimeout still!
if (netbuffer->packettype == PT_NODEKEEPALIVE
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
if (netbuffer->packettype == PT_NODEKEEPALIVE)
return;
// store it in an internal buffer so the last packet takes precedence, which minimizes input lag
@ -4749,9 +4739,9 @@ static void PT_ClientCmd(SINT8 node, INT32 netconsole)
return;
// Splitscreen cmd
if (((netbuffer->packettype == PT_CLIENT2CMD || netbuffer->packettype == PT_CLIENT2MIS)
|| (netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
if ((netbuffer->packettype == PT_CLIENT2CMD
|| netbuffer->packettype == PT_CLIENT3CMD
|| netbuffer->packettype == PT_CLIENT4CMD)
&& (nodetoplayer2[node] >= 0))
{
G_MoveTiccmd(&playercmds[(UINT8)nodetoplayer2[node]], &netbuffer->u.client2pak.cmd2, 1);
@ -4760,8 +4750,8 @@ static void PT_ClientCmd(SINT8 node, INT32 netconsole)
return;
}
if (((netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
|| (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS))
if ((netbuffer->packettype == PT_CLIENT3CMD
|| netbuffer->packettype == PT_CLIENT4CMD)
&& (nodetoplayer3[node] >= 0))
{
G_MoveTiccmd(&playercmds[(UINT8)nodetoplayer3[node]], &netbuffer->u.client3pak.cmd3, 1);
@ -4770,7 +4760,7 @@ static void PT_ClientCmd(SINT8 node, INT32 netconsole)
return;
}
if ((netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)
if (netbuffer->packettype == PT_CLIENT4CMD
&& (nodetoplayer4[node] >= 0))
{
G_MoveTiccmd(&playercmds[(UINT8)nodetoplayer4[node]], &netbuffer->u.client4pak.cmd4, 1);
@ -5110,7 +5100,6 @@ static void PT_ServerTics(SINT8 node, INT32 netconsole)
if (realend > gametic + CLIENTBACKUPTICS)
realend = gametic + CLIENTBACKUPTICS;
cl_packetmissed = realstart > neededtic;
if (realstart <= neededtic && realend > neededtic)
{
@ -5327,12 +5316,7 @@ static void HandlePacketFromPlayer(SINT8 node)
case PT_CLIENT2CMD : PT_ClientCmd (node, netconsole); break;
case PT_CLIENT3CMD : PT_ClientCmd (node, netconsole); break;
case PT_CLIENT4CMD : PT_ClientCmd (node, netconsole); break;
case PT_CLIENTMIS : PT_ClientCmd (node, netconsole); break;
case PT_CLIENT2MIS : PT_ClientCmd (node, netconsole); break;
case PT_CLIENT3MIS : PT_ClientCmd (node, netconsole); break;
case PT_CLIENT4MIS : PT_ClientCmd (node, netconsole); break;
case PT_NODEKEEPALIVE : PT_ClientCmd (node, netconsole); break;
case PT_NODEKEEPALIVEMIS : PT_ClientCmd (node, netconsole); break;
case PT_BASICKEEPALIVE : PT_BasicKeepAlive (node, netconsole); break;
case PT_TEXTCMD : PT_TextCmd (node, netconsole); break;
case PT_TEXTCMD2 : PT_TextCmd (node, netconsole); break;
@ -5764,23 +5748,16 @@ static void CL_SendClientCmd(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
size_t packetsize = 0;
boolean mis = false;
netbuffer->packettype = PT_CLIENTCMD;
if (cl_packetmissed)
{
netbuffer->packettype = PT_CLIENTMIS;
mis = true;
}
netbuffer->u.clientpak.resendfrom = (UINT8)(neededtic & UINT8_MAX);
netbuffer->u.clientpak.client_tic = (UINT8)(gametic & UINT8_MAX);
if (gamestate == GS_WAITINGPLAYERS)
{
// Send PT_NODEKEEPALIVE packet
netbuffer->packettype = (mis ? PT_NODEKEEPALIVEMIS : PT_NODEKEEPALIVE);
netbuffer->packettype = PT_NODEKEEPALIVE;
packetsize = sizeof (clientcmd_pak) - sizeof (ticcmd_t) - sizeof (INT16);
HSendPacket(servernode, false, 0, packetsize);
}
@ -5800,19 +5777,19 @@ static void CL_SendClientCmd(void)
if (splitscreen) // Send a special packet with 2 cmd for splitscreen
{
netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD);
netbuffer->packettype = PT_CLIENT2CMD;
packetsize = sizeof (client2cmd_pak);
G_MoveTiccmd(&netbuffer->u.client2pak.cmd2, &localcmds[1][lagDelay], 1);
if (splitscreen > 1)
{
netbuffer->packettype = (mis ? PT_CLIENT3MIS : PT_CLIENT3CMD);
netbuffer->packettype = PT_CLIENT3CMD;
packetsize = sizeof (client3cmd_pak);
G_MoveTiccmd(&netbuffer->u.client3pak.cmd3, &localcmds[2][lagDelay], 1);
if (splitscreen > 2)
{
netbuffer->packettype = (mis ? PT_CLIENT4MIS : PT_CLIENT4CMD);
netbuffer->packettype = PT_CLIENT4CMD;
packetsize = sizeof (client4cmd_pak);
G_MoveTiccmd(&netbuffer->u.client4pak.cmd4, &localcmds[3][lagDelay], 1);
}

View file

@ -73,11 +73,8 @@ typedef enum
// (must stay 1 for backwards compatibility).
// This is a positive response to a CLIENTJOIN request.
PT_CLIENTCMD, // Ticcmd of the client.
PT_CLIENTMIS, // Same as above with but saying resend from.
PT_CLIENT2CMD, // 2 cmds in the packet for splitscreen.
PT_CLIENT2MIS, // Same as above with but saying resend from
PT_NODEKEEPALIVE, // Same but without ticcmd and consistancy
PT_NODEKEEPALIVEMIS,
PT_SERVERTICS, // All cmds for the tic.
PT_SERVERREFUSE, // Server refuses joiner (reason inside).
PT_SERVERSHUTDOWN,
@ -102,9 +99,7 @@ typedef enum
// Kart-specific packets
PT_CLIENT3CMD, // 3P
PT_CLIENT3MIS,
PT_CLIENT4CMD, // 4P
PT_CLIENT4MIS,
PT_BASICKEEPALIVE,// Keep the network alive during wipes, as tics aren't advanced and NetUpdate isn't called
PT_CANFAIL, // This is kind of a priority. Anything bigger than CANFAIL

View file

@ -609,9 +609,7 @@ static const char *packettypename[NUMPACKETTYPE] =
"NOTHING",
"SERVERCFG",
"CLIENTCMD",
"CLIENTMIS",
"CLIENT2CMD",
"CLIENT2MIS",
"NODEKEEPALIVE",
"NODEKEEPALIVEMIS",
"SERVERTICS",
@ -634,9 +632,7 @@ static const char *packettypename[NUMPACKETTYPE] =
"HASLUAFILE",
"CLIENT3CMD",
"CLIENT3MIS",
"CLIENT4CMD",
"CLIENT4MIS",
"BASICKEEPALIVE",
"FILEFRAGMENT",
@ -696,12 +692,7 @@ static void DebugPrintpacket(const char *header)
case PT_CLIENT2CMD:
case PT_CLIENT3CMD:
case PT_CLIENT4CMD:
case PT_CLIENTMIS:
case PT_CLIENT2MIS:
case PT_CLIENT3MIS:
case PT_CLIENT4MIS:
case PT_NODEKEEPALIVE:
case PT_NODEKEEPALIVEMIS:
fprintf(debugfile, " tic %4u resendfrom %u\n",
(UINT32)netbuffer->u.clientpak.client_tic,
(UINT32)netbuffer->u.clientpak.resendfrom);