Disable the vanilla-sourced "keepbody" (rejointimeout) feature.

This commit is contained in:
toaster 2022-03-14 16:33:03 +00:00
parent 87fe8f2c9c
commit fcb6a4e1ab
13 changed files with 50 additions and 195 deletions

View file

@ -1621,7 +1621,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
// 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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}

View file

@ -93,7 +93,6 @@ UINT8 playerconsole[MAXPLAYERS];
// Server specific vars
UINT8 playernode[MAXPLAYERS];
char playeraddress[MAXPLAYERS][64];
// Minimum timeout for sending the savegame
// The actual timeout will be longer depending on the savegame length
@ -409,7 +408,7 @@ static void ExtraDataTicker(void)
{
if (server)
{
SendKick(i, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(i, KICK_MSG_CON_FAIL);
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]);
@ -460,9 +459,6 @@ void SendKick(UINT8 playernum, UINT8 msg)
{
UINT8 buf[2];
if (!(server && cv_rejointimeout.value))
msg &= ~KICK_MSG_KEEP_BODY;
buf[0] = playernum;
buf[1] = msg;
SendNetXCmd(XD_KICK, &buf, 2);
@ -807,37 +803,6 @@ static boolean CL_SendJoin(void)
return HSendPacket(servernode, false, 0, sizeof (clientconfig_pak));
}
static INT32 FindRejoinerNum(SINT8 node)
{
char strippednodeaddress[64];
const char *nodeaddress;
char *port;
INT32 i;
// Make sure there is no dead dress before proceeding to the stripping
if (!I_GetNodeAddress)
return -1;
nodeaddress = I_GetNodeAddress(node);
if (!nodeaddress)
return -1;
// Strip the address of its port
strcpy(strippednodeaddress, nodeaddress);
port = strchr(strippednodeaddress, ':');
if (port)
*port = '\0';
// Check if any player matches the stripped address
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && playeraddress[i][0] && playernode[i] == UINT8_MAX
&& !strcmp(playeraddress[i], strippednodeaddress))
return i;
}
return -1;
}
static void
CopyCaretColors (char *p, const char *s, int n)
{
@ -922,7 +887,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumPlayers();
netbuffer->u.serverinfo.maxplayer = (UINT8)(min((dedicated ? MAXPLAYERS-1 : MAXPLAYERS), cv_maxplayers.value));
if (!node || FindRejoinerNum(node) != -1)
if (!node)
netbuffer->u.serverinfo.refusereason = 0;
else if (!cv_allownewplayer.value)
netbuffer->u.serverinfo.refusereason = 1;
@ -1313,11 +1278,6 @@ static void CL_LoadReceivedSavegame(boolean reloading)
else
{
CONS_Alert(CONS_ERROR, M_GetText("Can't load the level!\n"));
Z_Free(savebuffer);
save_p = NULL;
if (unlink(tmpsave) == -1)
CONS_Alert(CONS_ERROR, M_GetText("Can't delete %s\n"), tmpsave);
return;
}
// done
@ -2356,7 +2316,6 @@ void CL_ClearPlayer(INT32 playernum)
splitscreen_original_party_size[playernum] = 0;
memset(&players[playernum], 0, sizeof (player_t));
memset(playeraddress[playernum], 0, sizeof(*playeraddress));
}
//
@ -2732,12 +2691,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
char buf[3 + MAX_REASONLENGTH];
char *reason = buf;
kickreason_t kickreason = KR_KICK;
boolean keepbody;
pnum = READUINT8(*p);
msg = READUINT8(*p);
keepbody = (msg & KICK_MSG_KEEP_BODY) != 0;
msg &= ~KICK_MSG_KEEP_BODY;
if (pnum == serverplayer && IsPlayerAdmin(playernum))
{
@ -2791,7 +2747,6 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
*/
pnum = playernum;
msg = KICK_MSG_CON_FAIL;
keepbody = true;
}
//CONS_Printf("\x82%s ", player_names[pnum]);
@ -2816,8 +2771,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
switch (msg)
{
case KICK_MSG_GO_AWAY:
if (!players[pnum].quittime)
HU_AddChatText(va("\x82*%s has been kicked (Go away)", player_names[pnum]), false);
HU_AddChatText(va("\x82*%s has been kicked (Go away)", player_names[pnum]), false);
kickreason = KR_KICK;
break;
case KICK_MSG_PING_HIGH:
@ -2866,7 +2820,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
kickreason = KR_TIMEOUT;
break;
case KICK_MSG_PLAYER_QUIT:
if (netgame && !players[pnum].quittime) // not splitscreen/bots or soulless body
if (netgame) // not splitscreen/bots
HU_AddChatText(va("\x82*%s left the game", player_names[pnum]), false);
kickreason = KR_LEAVE;
break;
@ -2923,24 +2877,6 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
else
M_StartMessage(M_GetText("You have been kicked by the server\n\nPress ESC\n"), NULL, MM_NOTHING);
}
else if (keepbody)
{
if (server && !demo.playback && playernode[pnum] != UINT8_MAX)
{
INT32 node = playernode[pnum];
playerpernode[node]--;
if (playerpernode[node] <= 0)
{
nodeingame[node] = false;
Net_CloseConnection(node);
ResetNode(node);
}
}
playernode[pnum] = UINT8_MAX;
players[pnum].quittime = 1;
}
else if (server)
{
// Sal: Because kicks (and a lot of other commands) are player-based, we can't tell which player pnum is on the node from a glance.
@ -3086,8 +3022,6 @@ consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_CALL, maxplay
static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}};
consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE|CV_NETVAR, joindelay_cons_t, NULL);
static CV_PossibleValue_t rejointimeout_cons_t[] = {{1, "MIN"}, {60 * FRACUNIT, "MAX"}, {0, "Off"}, {0, NULL}};
consvar_t cv_rejointimeout = CVAR_INIT ("rejointimeout", "Off", CV_SAVE|CV_NETVAR|CV_FLOAT, rejointimeout_cons_t, NULL);
// Here for dedicated servers
static CV_PossibleValue_t discordinvites_cons_t[] = {{0, "Admins Only"}, {1, "Everyone"}, {0, NULL}};
@ -3221,7 +3155,6 @@ void SV_ResetServer(void)
LUA_InvalidatePlayer(&players[i]);
playeringame[i] = false;
playernode[i] = UINT8_MAX;
memset(playeraddress[i], 0, sizeof(*playeraddress));
sprintf(player_names[i], "Player %c", 'A' + i);
adminplayers[i] = -1; // Populate the entire adminplayers array with -1.
K_ClearClientPowerLevels();
@ -3342,7 +3275,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
UINT8 console;
UINT8 splitscreenplayer = 0;
UINT8 i;
boolean rejoined;
player_t *newplayer;
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
@ -3350,7 +3282,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
// protect against hacked/buggy client
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -3359,9 +3291,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
CONS_Debug(DBG_NETPLAY, "addplayer: %d %d\n", node, newplayernum);
rejoined = playeringame[newplayernum];
if (!rejoined)
{
// Clear player before joining, lest some things get set incorrectly
CL_ClearPlayer(newplayernum);
@ -3371,25 +3300,11 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (newplayernum+1 > doomcom->numslots)
doomcom->numslots = (INT16)(newplayernum+1);
if (server && I_GetNodeAddress)
{
const char *address = I_GetNodeAddress(node);
char *port = NULL;
if (address) // MI: fix msvcrt.dll!_mbscat crash?
{
strcpy(playeraddress[newplayernum], address);
port = strchr(playeraddress[newplayernum], ':');
if (port)
*port = '\0';
}
}
}
newplayer = &players[newplayernum];
newplayer->jointime = 0;
newplayer->quittime = 0;
READSTRINGN(*p, player_names[newplayernum], MAXPLAYERNAME);
@ -3423,27 +3338,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
D_SendPlayerConfig(splitscreenplayer);
addedtogame = true;
if (rejoined)
{
if (newplayer->mo)
{
newplayer->viewheight = P_GetPlayerViewHeight(newplayer);
if (newplayer->mo->eflags & MFE_VERTICALFLIP)
newplayer->viewz = newplayer->mo->z + newplayer->mo->height - newplayer->viewheight;
else
newplayer->viewz = newplayer->mo->z + newplayer->viewheight;
}
// wake up the status bar
ST_Start();
// wake up the heads up text
HU_Start();
if (camera[splitscreenplayer].chase)
P_ResetCamera(newplayer, &camera[splitscreenplayer]);
}
}
players[newplayernum].splitscreenindex = splitscreenplayer;
@ -3459,10 +3353,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
{
char joinmsg[256];
if (rejoined)
strcpy(joinmsg, M_GetText("\x82*%s has rejoined the game (player %d)"));
else
strcpy(joinmsg, M_GetText("\x82*%s has joined the game (player %d)"));
strcpy(joinmsg, M_GetText("\x82*%s has joined the game (player %d)"));
strcpy(joinmsg, va(joinmsg, player_names[newplayernum], newplayernum));
if (node != mynode)
@ -3482,8 +3373,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
if (server && multiplayer && motd[0] != '\0')
COM_BufAddText(va("sayto %d %s\n", newplayernum, motd));
if (!rejoined)
LUAh_PlayerJoin(newplayernum);
LUAh_PlayerJoin(newplayernum);
#ifdef HAVE_DISCORDRPC
DRPC_UpdatePresence();
@ -3501,7 +3391,7 @@ static void Got_RemovePlayer(UINT8 **p, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal remove player command received from %s\n"), player_names[playernum]);
if (server)
{
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
return;
}
@ -3530,7 +3420,7 @@ static void Got_AddBot(UINT8 **p, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal add player command received from %s\n"), player_names[playernum]);
if (server)
{
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
return;
}
@ -3580,13 +3470,11 @@ static boolean SV_AddWaitingPlayers(SINT8 node, const char *name, const char *na
{
newplayer = true;
newplayernum = FindRejoinerNum(node);
if (newplayernum == -1)
{
UINT8 nobotoverwrite;
// search for a free playernum
// we can't use playeringame since it is not updated here
// we can't solely use playeringame since it is not updated here
for (newplayernum = dedicated ? 1 : 0; newplayernum < MAXPLAYERS; newplayernum++)
{
if (playeringame[newplayernum])
@ -3809,7 +3697,6 @@ static size_t TotalTextCmdPerTic(tic_t tic)
static void HandleConnect(SINT8 node)
{
char names[MAXSPLITSCREENPLAYERS][MAXPLAYERNAME + 1];
INT32 rejoinernum;
INT32 i;
// Sal: Dedicated mode is INCREDIBLY hacked together.
@ -3817,8 +3704,6 @@ static void HandleConnect(SINT8 node)
// It's too much effort to legimately fix right now. Just prevent it from reaching that state.
UINT8 maxplayers = min((dedicated ? MAXPLAYERS-1 : MAXPLAYERS), cv_maxplayers.value);
rejoinernum = FindRejoinerNum(node);
if (bannednode && bannednode[node])
SV_SendRefuse(node, M_GetText("You have been banned\nfrom the server."));
else if (netbuffer->u.clientcfg._255 != 255 ||
@ -3830,9 +3715,9 @@ static void HandleConnect(SINT8 node)
else if (netbuffer->u.clientcfg.version != VERSION
|| netbuffer->u.clientcfg.subversion != SUBVERSION)
SV_SendRefuse(node, va(M_GetText("Different SRB2Kart versions cannot\nplay a netgame!\n(server version %d.%d)"), VERSION, SUBVERSION));
else if (!cv_allownewplayer.value && node && rejoinernum == -1)
else if (!cv_allownewplayer.value && node)
SV_SendRefuse(node, M_GetText("The server is not accepting\njoins for the moment."));
else if (D_NumPlayers() >= maxplayers && rejoinernum == -1)
else if (D_NumPlayers() >= maxplayers)
SV_SendRefuse(node, va(M_GetText("Maximum players reached: %d"), maxplayers));
else if (netgame && netbuffer->u.clientcfg.localplayers > MAXSPLITSCREENPLAYERS) // Hacked client?
SV_SendRefuse(node, M_GetText("Too many players from\nthis node."));
@ -3854,7 +3739,7 @@ static void HandleConnect(SINT8 node)
for (i = 0; i < netbuffer->u.clientcfg.localplayers - playerpernode[node]; i++)
{
strlcpy(names[i], netbuffer->u.clientcfg.names[i], MAXPLAYERNAME + 1);
if (!EnsurePlayerNameIsGood(names[i], rejoinernum))
if (!EnsurePlayerNameIsGood(names[i], -1))
{
SV_SendRefuse(node, "Bad player name");
return;
@ -4413,7 +4298,7 @@ static void HandlePacketFromPlayer(SINT8 node)
}
else
{
SendKick(netconsole, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(netconsole, KICK_MSG_CON_FAIL);
DEBFILE(va("player %d kicked (synch failure) [%u] %d!=%d\n",
netconsole, realstart, consistancy[realstart%TICQUEUE],
SHORT(netbuffer->u.clientpak.consistancy)));
@ -4552,7 +4437,6 @@ static void HandlePacketFromPlayer(SINT8 node)
kickmsg = KICK_MSG_TIMEOUT;
else
kickmsg = KICK_MSG_PLAYER_QUIT;
kickmsg |= KICK_MSG_KEEP_BODY;
SendKick(netconsole, kickmsg);
@ -4607,7 +4491,7 @@ static void HandlePacketFromPlayer(SINT8 node)
{
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_SERVERTICS", node);
if (server)
SendKick(netconsole, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(netconsole, KICK_MSG_CON_FAIL);
break;
}
@ -4667,7 +4551,7 @@ static void HandlePacketFromPlayer(SINT8 node)
{
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_PING", node);
if (server)
SendKick(netconsole, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(netconsole, KICK_MSG_CON_FAIL);
break;
}
@ -4691,7 +4575,7 @@ static void HandlePacketFromPlayer(SINT8 node)
{
CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_FILEFRAGMENT", node);
if (server)
SendKick(netconsole, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(netconsole, KICK_MSG_CON_FAIL);
break;
}
if (client)
@ -5220,13 +5104,6 @@ static void SV_Maketic(void)
ticcmd_t * ticcmd = &netcmds[(maketic ) % TICQUEUE][i];
ticcmd_t *prevticcmd = &netcmds[(maketic - 1) % TICQUEUE][i];
if (players[i].quittime)
{
// empty inputs but consider recieved
memset(ticcmd, 0, sizeof(netcmds[0][0]));
ticcmd->flags |= TICCMD_RECEIVED;
}
else
{
DEBFILE(va("MISS tic%4d for player %d\n", maketic, i));
// Copy the input from the previous tic
@ -5365,7 +5242,7 @@ static inline void PingUpdate(void)
{
for (i = 1; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].quittime
if (playeringame[i]
&& (realpingtable[i] / pingmeasurecount > (unsigned)cv_maxping.value))
{
if (players[i].jointime > 30 * TICRATE)
@ -5390,7 +5267,7 @@ static inline void PingUpdate(void)
if (pingtimeout[i] > cv_pingtimeout.value)
{
pingtimeout[i] = 0;
SendKick(i, KICK_MSG_PING_HIGH | KICK_MSG_KEEP_BODY);
SendKick(i, KICK_MSG_PING_HIGH);
}
}
/*

View file

@ -409,7 +409,6 @@ extern consvar_t cv_playbackspeed;
#define KICK_MSG_PING_HIGH 6
#define KICK_MSG_CUSTOM_KICK 7
#define KICK_MSG_CUSTOM_BAN 8
#define KICK_MSG_KEEP_BODY 0x80
typedef enum
{
@ -445,7 +444,7 @@ extern tic_t servermaxping;
extern boolean server_lagless;
extern consvar_t cv_netticbuffer, cv_allownewplayer, cv_maxplayers, cv_joindelay, cv_rejointimeout;
extern consvar_t cv_netticbuffer, cv_allownewplayer, cv_maxplayers, cv_joindelay;
extern consvar_t cv_resynchattempts, cv_blamecfail;
extern consvar_t cv_maxsend, cv_noticedownload, cv_downloadspeed;

View file

@ -717,7 +717,6 @@ void D_RegisterServerCommands(void)
// d_clisrv
CV_RegisterVar(&cv_maxplayers);
CV_RegisterVar(&cv_joindelay);
CV_RegisterVar(&cv_rejointimeout);
CV_RegisterVar(&cv_resynchattempts);
CV_RegisterVar(&cv_maxsend);
CV_RegisterVar(&cv_noticedownload);
@ -1280,7 +1279,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
{
CONS_Printf(M_GetText("Player %d sent a bad name change\n"), playernum+1);
if (server && netgame)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
}
@ -1609,7 +1608,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
if (kick)
{
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 | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
}
@ -1714,7 +1713,7 @@ static void Got_PartyInvite(UINT8 **cp,INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal splitscreen invitation received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -1745,7 +1744,7 @@ static void Got_AcceptPartyInvite(UINT8 **cp,INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal accept splitscreen invite received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -1809,7 +1808,7 @@ static void Got_CancelPartyInvite(UINT8 **cp,INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal cancel splitscreen invite received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
}
@ -1821,7 +1820,7 @@ static void Got_LeaveParty(UINT8 **cp,INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal accept splitscreen invite received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -2838,7 +2837,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -2951,7 +2950,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -3028,7 +3027,7 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -3098,7 +3097,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -3334,7 +3333,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
// 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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
if (NetPacket.packet.verification) // Special marker that the server sent the request
@ -3343,7 +3342,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
playernum = NetPacket.packet.playernum;
@ -3368,7 +3367,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
return;
}
@ -3392,7 +3391,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
//Safety first!
@ -3679,7 +3678,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -3729,7 +3728,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -3803,7 +3802,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
Z_Free(mymotd);
return;
}
@ -3859,7 +3858,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -4053,7 +4052,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
if ((playernum != serverplayer && !IsPlayerAdmin(playernum)) || kick)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -4101,7 +4100,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -4839,7 +4838,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -4855,7 +4854,7 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal vote setup received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -4894,7 +4893,7 @@ static void Got_PickVotecmd(UINT8 **cp, INT32 playernum)
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal vote setup received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -4918,7 +4917,7 @@ static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum)
M_GetText ("Illegal give item received from %s\n"),
player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -5824,7 +5823,7 @@ void Got_DiscordInfo(UINT8 **p, INT32 playernum)
// protect against hacked/buggy client
CONS_Alert(CONS_WARNING, M_GetText("Illegal Discord info command received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}

View file

@ -547,7 +547,6 @@ typedef struct player_s
UINT8 splitscreenindex;
tic_t jointime; // Timer when player joins game to change skin/color
tic_t quittime; // Time elapsed since user disconnected, zero if connected
UINT8 typing_timer; // Counts down while keystrokes are not emitted
UINT8 typing_duration; // How long since resumed timer

View file

@ -2105,7 +2105,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
UINT32 availabilities;
tic_t jointime;
tic_t quittime;
UINT8 splitscreenindex;
boolean spectator;
@ -2140,7 +2139,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
ctfteam = players[player].ctfteam;
jointime = players[player].jointime;
quittime = players[player].quittime;
splitscreenindex = players[player].splitscreenindex;
spectator = players[player].spectator;
@ -2256,7 +2254,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
p->pflags = pflags;
p->ctfteam = ctfteam;
p->jointime = jointime;
p->quittime = quittime;
p->splitscreenindex = splitscreenindex;
p->spectator = spectator;
p->steering = steering;

View file

@ -641,7 +641,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"),
player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
@ -655,7 +655,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]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
return;
}
}

View file

@ -260,7 +260,7 @@ void K_UpdateMatchRaceBots(void)
--------------------------------------------------*/
boolean K_PlayerUsesBotMovement(player_t *player)
{
if (player->bot || player->exiting || player->quittime)
if (player->bot || player->exiting)
return true;
return false;

View file

@ -90,7 +90,7 @@ deny:
CONS_Alert(CONS_WARNING, M_GetText("Illegal lua command received from %s\n"), player_names[playernum]);
if (server)
SendKick(playernum, KICK_MSG_CON_FAIL | KICK_MSG_KEEP_BODY);
SendKick(playernum, KICK_MSG_CON_FAIL);
}
// Wrapper for COM_AddCommand commands

View file

@ -461,8 +461,6 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->jointime);
else if (fastcmp(field,"splitscreenindex"))
lua_pushinteger(L, plr->splitscreenindex);
else if (fastcmp(field,"quittime"))
lua_pushinteger(L, plr->quittime);
#ifdef HWRENDER
else if (fastcmp(field,"fovadd"))
lua_pushfixed(L, plr->fovadd);

View file

@ -747,9 +747,6 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
if (player->bot)
continue; // ignore bots
if (player->quittime)
continue; // Ignore uncontrolled bodies
if (dist > 0
&& P_AproxDistance(P_AproxDistance(player->mo->x - actor->x, player->mo->y - actor->y), player->mo->z - actor->z) > dist)
continue; // Too far away

View file

@ -192,7 +192,6 @@ static void P_NetArchivePlayers(void)
WRITEINT32(save_p, players[i].onconveyor);
WRITEUINT32(save_p, players[i].jointime);
WRITEUINT32(save_p, players[i].quittime);
WRITEUINT8(save_p, players[i].splitscreenindex);
@ -455,7 +454,6 @@ static void P_NetUnArchivePlayers(void)
players[i].onconveyor = READINT32(save_p);
players[i].jointime = READUINT32(save_p);
players[i].quittime = READUINT32(save_p);
players[i].splitscreenindex = READUINT8(save_p);

View file

@ -502,15 +502,6 @@ void P_Ticker(boolean run)
if (playeringame[i])
{
players[i].jointime++;
if (players[i].quittime)
{
players[i].quittime++;
if (server && players[i].quittime >= (tic_t)FixedMul(cv_rejointimeout.value, 60 * TICRATE)
&& !(players[i].quittime % TICRATE))
SendKick(i, KICK_MSG_PLAYER_QUIT);
}
}
if (objectplacing)