mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Merge remote-tracking branch 'origin/master' into next
This commit is contained in:
commit
2b95ea0135
8 changed files with 69 additions and 250 deletions
|
@ -1457,15 +1457,8 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
// not from server or remote admin, must be hacked/buggy client
|
// not from server or remote admin, must be hacked/buggy client
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal netvar command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal netvar command received from %s\n"), player_names[playernum]);
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
netid = READUINT16(*p);
|
netid = READUINT16(*p);
|
||||||
|
|
|
@ -612,15 +612,6 @@ void CON_Ticker(void)
|
||||||
con_tick++;
|
con_tick++;
|
||||||
con_tick &= 7;
|
con_tick &= 7;
|
||||||
|
|
||||||
// if the menu is open then close the console.
|
|
||||||
if (menuactive && con_destlines)
|
|
||||||
{
|
|
||||||
consoletoggle = false;
|
|
||||||
con_destlines = 0;
|
|
||||||
CON_ClearHUD();
|
|
||||||
I_UpdateMouseGrab();
|
|
||||||
}
|
|
||||||
|
|
||||||
// console key was pushed
|
// console key was pushed
|
||||||
if (consoletoggle)
|
if (consoletoggle)
|
||||||
{
|
{
|
||||||
|
@ -777,7 +768,7 @@ boolean CON_Responder(event_t *ev)
|
||||||
// check for console toggle key
|
// check for console toggle key
|
||||||
if (ev->type != ev_console)
|
if (ev->type != ev_console)
|
||||||
{
|
{
|
||||||
if (modeattacking || metalrecording)
|
if (modeattacking || metalrecording || menuactive)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
|
if (key == gamecontrol[gc_console][0] || key == gamecontrol[gc_console][1])
|
||||||
|
@ -792,7 +783,7 @@ boolean CON_Responder(event_t *ev)
|
||||||
// check other keys only if console prompt is active
|
// check other keys only if console prompt is active
|
||||||
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
|
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
|
||||||
{
|
{
|
||||||
if (bindtable[key])
|
if (! menuactive && bindtable[key])
|
||||||
{
|
{
|
||||||
COM_BufAddText(bindtable[key]);
|
COM_BufAddText(bindtable[key]);
|
||||||
COM_BufAddText("\n");
|
COM_BufAddText("\n");
|
||||||
|
@ -1551,9 +1542,14 @@ static void CON_DrawConsole(void)
|
||||||
if (cons_backpic.value || con_forcepic)
|
if (cons_backpic.value || con_forcepic)
|
||||||
{
|
{
|
||||||
patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_PATCH);
|
patch_t *con_backpic = W_CachePatchName("CONSBACK", PU_PATCH);
|
||||||
|
int h;
|
||||||
|
|
||||||
|
h = con_curlines/vid.dupy;
|
||||||
|
|
||||||
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch
|
// Jimita: CON_DrawBackpic just called V_DrawScaledPatch
|
||||||
V_DrawScaledPatch(0, 0, 0, con_backpic);
|
//V_DrawScaledPatch(0, 0, 0, con_backpic);
|
||||||
|
V_DrawCroppedPatch(0, 0, FRACUNIT, 0, con_backpic,
|
||||||
|
0, ( BASEVIDHEIGHT - h ), BASEVIDWIDTH, h);
|
||||||
|
|
||||||
W_UnlockCachedPatch(con_backpic);
|
W_UnlockCachedPatch(con_backpic);
|
||||||
}
|
}
|
||||||
|
|
116
src/d_clisrv.c
116
src/d_clisrv.c
|
@ -391,11 +391,7 @@ static void ExtraDataTicker(void)
|
||||||
{
|
{
|
||||||
if (server)
|
if (server)
|
||||||
{
|
{
|
||||||
UINT8 buf[3];
|
SendKick(i, KICK_MSG_CON_FAIL);
|
||||||
|
|
||||||
buf[0] = (UINT8)i;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
|
DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
|
||||||
}
|
}
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
|
CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]);
|
||||||
|
@ -437,6 +433,15 @@ void D_ResetTiccmds(void)
|
||||||
D_Clearticcmd(textcmds[i]->tic);
|
D_Clearticcmd(textcmds[i]->tic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SendKick(UINT8 playernum, UINT8 msg)
|
||||||
|
{
|
||||||
|
UINT8 buf[2];
|
||||||
|
|
||||||
|
buf[0] = playernum;
|
||||||
|
buf[1] = msg;
|
||||||
|
SendNetXCmd(XD_KICK, &buf, 2);
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
// end of extra data function
|
// end of extra data function
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
@ -1053,10 +1058,7 @@ static void SV_SendResynch(INT32 node)
|
||||||
|
|
||||||
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
|
if (resynch_score[node] > (unsigned)cv_resynchattempts.value*250)
|
||||||
{
|
{
|
||||||
UINT8 buf[2];
|
SendKick(nodetoplayer[node], KICK_MSG_CON_FAIL);
|
||||||
buf[0] = (UINT8)nodetoplayer[node];
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
resynch_score[node] = 0;
|
resynch_score[node] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1346,11 +1348,11 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||||
{
|
{
|
||||||
if (!playeringame[i])
|
if (!playeringame[i])
|
||||||
{
|
{
|
||||||
netbuffer->u.playerinfo[i].node = 255; // This slot is empty.
|
netbuffer->u.playerinfo[i].num = 255; // This slot is empty.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
netbuffer->u.playerinfo[i].node = i;
|
netbuffer->u.playerinfo[i].num = i;
|
||||||
strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1);
|
strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1);
|
||||||
netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0';
|
netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0';
|
||||||
|
|
||||||
|
@ -3216,13 +3218,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
// protect against hacked/buggy client
|
// protect against hacked/buggy client
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3405,14 +3401,10 @@ void CL_AddSplitscreenPlayer(void)
|
||||||
|
|
||||||
void CL_RemoveSplitscreenPlayer(void)
|
void CL_RemoveSplitscreenPlayer(void)
|
||||||
{
|
{
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
if (cl_mode != CL_CONNECTED)
|
if (cl_mode != CL_CONNECTED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
buf[0] = (UINT8)secondarydisplayplayer;
|
SendKick(secondarydisplayplayer, KICK_MSG_PLAYER_QUIT);
|
||||||
buf[1] = KICK_MSG_PLAYER_QUIT;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// is there a game running
|
// is there a game running
|
||||||
|
@ -3951,13 +3943,10 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
if (netcmds[maketic%BACKUPTICS][netconsole].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].forwardmove < -MAXPLMOVE
|
if (netcmds[maketic%BACKUPTICS][netconsole].forwardmove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].forwardmove < -MAXPLMOVE
|
||||||
|| netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE)
|
|| netcmds[maketic%BACKUPTICS][netconsole].sidemove > MAXPLMOVE || netcmds[maketic%BACKUPTICS][netconsole].sidemove < -MAXPLMOVE)
|
||||||
{
|
{
|
||||||
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"), netconsole);
|
||||||
//D_Clearticcmd(k);
|
//D_Clearticcmd(k);
|
||||||
|
|
||||||
buf[0] = (char)netconsole;
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3994,11 +3983,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT8 buf[3];
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
|
|
||||||
buf[0] = (UINT8)netconsole;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
DEBFILE(va("player %d kicked (synch failure) [%u] %d!=%d\n",
|
DEBFILE(va("player %d kicked (synch failure) [%u] %d!=%d\n",
|
||||||
netconsole, realstart, consistancy[realstart%BACKUPTICS],
|
netconsole, realstart, consistancy[realstart%BACKUPTICS],
|
||||||
SHORT(netbuffer->u.clientpak.consistancy)));
|
SHORT(netbuffer->u.clientpak.consistancy)));
|
||||||
|
@ -4111,19 +4096,20 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
nodewaiting[node] = 0;
|
nodewaiting[node] = 0;
|
||||||
if (netconsole != -1 && playeringame[netconsole])
|
if (netconsole != -1 && playeringame[netconsole])
|
||||||
{
|
{
|
||||||
UINT8 buf[2];
|
UINT8 kickmsg;
|
||||||
buf[0] = (UINT8)netconsole;
|
|
||||||
if (netbuffer->packettype == PT_NODETIMEOUT)
|
if (netbuffer->packettype == PT_NODETIMEOUT)
|
||||||
buf[1] = KICK_MSG_TIMEOUT;
|
kickmsg = KICK_MSG_TIMEOUT;
|
||||||
else
|
else
|
||||||
buf[1] = KICK_MSG_PLAYER_QUIT;
|
kickmsg = KICK_MSG_PLAYER_QUIT;
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
|
SendKick(netconsole, kickmsg);
|
||||||
nodetoplayer[node] = -1;
|
nodetoplayer[node] = -1;
|
||||||
|
|
||||||
if (nodetoplayer2[node] != -1 && nodetoplayer2[node] >= 0
|
if (nodetoplayer2[node] != -1 && nodetoplayer2[node] >= 0
|
||||||
&& playeringame[(UINT8)nodetoplayer2[node]])
|
&& playeringame[(UINT8)nodetoplayer2[node]])
|
||||||
{
|
{
|
||||||
buf[0] = nodetoplayer2[node];
|
SendKick(nodetoplayer2[node], kickmsg);
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
nodetoplayer2[node] = -1;
|
nodetoplayer2[node] = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4136,15 +4122,8 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
if (node != servernode)
|
if (node != servernode)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHEND", node);
|
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHEND", node);
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
buf[0] = (UINT8)node;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resynch_local_inprogress = false;
|
resynch_local_inprogress = false;
|
||||||
|
@ -4161,15 +4140,8 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
if (node != servernode)
|
if (node != servernode)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_SERVERTICS", node);
|
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_SERVERTICS", node);
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
buf[0] = (UINT8)node;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4228,15 +4200,8 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
if (node != servernode)
|
if (node != servernode)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHING", node);
|
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHING", node);
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
char buf[2];
|
|
||||||
buf[0] = (char)node;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resynch_local_inprogress = true;
|
resynch_local_inprogress = true;
|
||||||
|
@ -4247,15 +4212,8 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
if (node != servernode)
|
if (node != servernode)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_PING", node);
|
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_PING", node);
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
char buf[2];
|
|
||||||
buf[0] = (char)node;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4278,15 +4236,8 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
if (node != servernode)
|
if (node != servernode)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node);
|
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node);
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(netconsole, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
buf[0] = (UINT8)node;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (client)
|
if (client)
|
||||||
|
@ -4833,13 +4784,8 @@ static inline void PingUpdate(void)
|
||||||
if (pingtimeout[i] > cv_pingtimeout.value)
|
if (pingtimeout[i] > cv_pingtimeout.value)
|
||||||
// ok your net has been bad for too long, you deserve to die.
|
// ok your net has been bad for too long, you deserve to die.
|
||||||
{
|
{
|
||||||
char buf[2];
|
|
||||||
|
|
||||||
pingtimeout[i] = 0;
|
pingtimeout[i] = 0;
|
||||||
|
SendKick(i, KICK_MSG_PING_HIGH);
|
||||||
buf[0] = (char)i;
|
|
||||||
buf[1] = KICK_MSG_PING_HIGH;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -398,7 +398,7 @@ typedef struct
|
||||||
// Shorter player information for external use.
|
// Shorter player information for external use.
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 node;
|
UINT8 num;
|
||||||
char name[MAXPLAYERNAME+1];
|
char name[MAXPLAYERNAME+1];
|
||||||
UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH
|
UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH
|
||||||
UINT8 team;
|
UINT8 team;
|
||||||
|
@ -523,6 +523,7 @@ void D_ClientServerInit(void);
|
||||||
void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum));
|
void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum));
|
||||||
void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam);
|
void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam);
|
||||||
void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam); // splitsreen player
|
void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam); // splitsreen player
|
||||||
|
void SendKick(UINT8 playernum, UINT8 msg);
|
||||||
|
|
||||||
// Create any new ticcmds and broadcast to other players.
|
// Create any new ticcmds and broadcast to other players.
|
||||||
void NetUpdate(void);
|
void NetUpdate(void);
|
||||||
|
|
15
src/d_main.c
15
src/d_main.c
|
@ -188,14 +188,14 @@ void D_ProcessEvents(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Menu input
|
|
||||||
if (M_Responder(ev))
|
|
||||||
continue; // menu ate the event
|
|
||||||
|
|
||||||
// console input
|
// console input
|
||||||
if (CON_Responder(ev))
|
if (CON_Responder(ev))
|
||||||
continue; // ate the event
|
continue; // ate the event
|
||||||
|
|
||||||
|
// Menu input
|
||||||
|
if (M_Responder(ev))
|
||||||
|
continue; // menu ate the event
|
||||||
|
|
||||||
G_Responder(ev);
|
G_Responder(ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -502,13 +502,12 @@ static void D_Display(void)
|
||||||
// vid size change is now finished if it was on...
|
// vid size change is now finished if it was on...
|
||||||
vid.recalc = 0;
|
vid.recalc = 0;
|
||||||
|
|
||||||
// FIXME: draw either console or menu, not the two
|
|
||||||
if (gamestate != GS_TIMEATTACK)
|
|
||||||
CON_Drawer();
|
|
||||||
|
|
||||||
M_Drawer(); // menu is drawn even on top of everything
|
M_Drawer(); // menu is drawn even on top of everything
|
||||||
// focus lost moved to M_Drawer
|
// focus lost moved to M_Drawer
|
||||||
|
|
||||||
|
if (gamestate != GS_TIMEATTACK)
|
||||||
|
CON_Drawer();
|
||||||
|
|
||||||
//
|
//
|
||||||
// wipe update
|
// wipe update
|
||||||
//
|
//
|
||||||
|
|
132
src/d_netcmd.c
132
src/d_netcmd.c
|
@ -1124,13 +1124,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
|
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
|
||||||
if (server && netgame)
|
if (server && netgame)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1487,12 +1481,8 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
if (kick)
|
if (kick)
|
||||||
{
|
{
|
||||||
UINT8 buf[2];
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
|
||||||
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2032,13 +2022,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal map change received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2149,13 +2133,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal pause command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2230,13 +2208,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2299,13 +2271,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal clear scores command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2652,13 +2618,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
// this should never happen unless the client is hacked/buggy
|
// this should never happen unless the client is hacked/buggy
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NetPacket.packet.verification) // Special marker that the server sent the request
|
if (NetPacket.packet.verification) // Special marker that the server sent the request
|
||||||
|
@ -2667,13 +2627,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
playernum = NetPacket.packet.playernum;
|
playernum = NetPacket.packet.playernum;
|
||||||
|
@ -2706,13 +2660,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2770,12 +2718,8 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
|
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
|
||||||
{
|
{
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Safety first!
|
//Safety first!
|
||||||
|
@ -3067,13 +3011,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal verification received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3123,13 +3061,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal demotion received from %s (serverplayer is %s)\n"), player_names[playernum], player_names[serverplayer]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3203,14 +3135,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal motd change received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Z_Free(mymotd);
|
Z_Free(mymotd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3266,13 +3191,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal runsoc command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3429,13 +3348,8 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
|
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
|
||||||
{
|
{
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
||||||
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3484,13 +3398,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4283,13 +4191,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal exitlevel command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -659,13 +659,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"),
|
M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"),
|
||||||
player_names[playernum]);
|
player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 buf[2];
|
|
||||||
|
|
||||||
buf[0] = (UINT8)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,13 +673,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal say command received from %s containing invalid characters\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal say command received from %s containing invalid characters\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
char buf[2];
|
|
||||||
|
|
||||||
buf[0] = (char)playernum;
|
|
||||||
buf[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &buf, 2);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,13 +87,7 @@ deny:
|
||||||
|
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
|
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
|
||||||
if (server)
|
if (server)
|
||||||
{
|
SendKick(playernum, KICK_MSG_CON_FAIL);
|
||||||
UINT8 bufn[2];
|
|
||||||
|
|
||||||
bufn[0] = (UINT8)playernum;
|
|
||||||
bufn[1] = KICK_MSG_CON_FAIL;
|
|
||||||
SendNetXCmd(XD_KICK, &bufn, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapper for COM_AddCommand commands
|
// Wrapper for COM_AddCommand commands
|
||||||
|
|
Loading…
Reference in a new issue