lj dm'd me so here's a second, more sensible crack at it

This commit is contained in:
toaster 2018-12-18 19:40:38 +00:00
parent 99e50250cf
commit 0aabcd2503
3 changed files with 46 additions and 14 deletions

View file

@ -3973,10 +3973,10 @@ FILESTAMP
|| netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE) || netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE)
{ {
XBOXSTATIC char buf[2]; XBOXSTATIC char buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), netconsole); CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), node);
//D_Clearticcmd(k); //D_Clearticcmd(k);
buf[0] = (char)netconsole; buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL; buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2); SendNetXCmd(XD_KICK, &buf, 2);
break; break;
@ -3990,6 +3990,20 @@ FILESTAMP
{ {
G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]], G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]],
&netbuffer->u.client2pak.cmd2, 1); &netbuffer->u.client2pak.cmd2, 1);
// more "speed hacks"
if (netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]].forwardmove < -MAXPLMOVE
|| netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]].sidemove < -MAXPLMOVE)
{
XBOXSTATIC char buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), node);
//D_Clearticcmd(k);
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
break;
}
} }
if (((netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS) if (((netbuffer->packettype == PT_CLIENT3CMD || netbuffer->packettype == PT_CLIENT3MIS)
@ -3998,6 +4012,20 @@ FILESTAMP
{ {
G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]], G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]],
&netbuffer->u.client3pak.cmd3, 1); &netbuffer->u.client3pak.cmd3, 1);
// more "speed hacks"
if (netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]].forwardmove < -MAXPLMOVE
|| netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]].sidemove < -MAXPLMOVE)
{
XBOXSTATIC char buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), node);
//D_Clearticcmd(k);
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
break;
}
} }
if ((netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS) if ((netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)
@ -4005,6 +4033,20 @@ FILESTAMP
{ {
G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]], G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]],
&netbuffer->u.client4pak.cmd4, 1); &netbuffer->u.client4pak.cmd4, 1);
// more "speed hacks"
if (netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]].forwardmove < -MAXPLMOVE
|| netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]].sidemove < -MAXPLMOVE)
{
XBOXSTATIC char buf[2];
CONS_Alert(CONS_WARNING, M_GetText("Illegal movement value received from node %d\n"), node);
//D_Clearticcmd(k);
buf[0] = (char)node;
buf[1] = KICK_MSG_CON_FAIL;
SendNetXCmd(XD_KICK, &buf, 2);
break;
}
} }
// A delay before we check resynching // A delay before we check resynching

View file

@ -1503,8 +1503,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
mousex = mousey = mlooky = 0; mousex = mousey = mlooky = 0;
// moved to P_3DMovement if (forward > MAXPLMOVE)
/*if (forward > MAXPLMOVE)
forward = MAXPLMOVE; forward = MAXPLMOVE;
else if (forward < -MAXPLMOVE) else if (forward < -MAXPLMOVE)
forward = -MAXPLMOVE; forward = -MAXPLMOVE;
@ -1512,7 +1511,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
if (side > MAXPLMOVE) if (side > MAXPLMOVE)
side = MAXPLMOVE; side = MAXPLMOVE;
else if (side < -MAXPLMOVE) else if (side < -MAXPLMOVE)
side = -MAXPLMOVE;*/ side = -MAXPLMOVE;
if (forward || side) if (forward || side)
{ {

View file

@ -4796,17 +4796,8 @@ static void P_3dMovement(player_t *player)
cmd->forwardmove = 50; cmd->forwardmove = 50;
} }
if (cmd->forwardmove > MAXPLMOVE)
cmd->forwardmove = MAXPLMOVE;
else if (cmd->forwardmove < -MAXPLMOVE)
cmd->forwardmove = -MAXPLMOVE;
if (!(player->pflags & PF_FORCESTRAFE) && !player->kartstuff[k_pogospring]) if (!(player->pflags & PF_FORCESTRAFE) && !player->kartstuff[k_pogospring])
cmd->sidemove = 0; cmd->sidemove = 0;
else if (cmd->sidemove > MAXPLMOVE)
cmd->sidemove = MAXPLMOVE;
else if (cmd->sidemove < -MAXPLMOVE)
cmd->sidemove = -MAXPLMOVE;
if (analogmove) if (analogmove)
{ {