Abstain from handling connections instead if the level is loading

This commit is contained in:
JugadorXEI 2021-05-30 23:36:07 +02:00
parent 63f87b4cec
commit 4fdbfb1dc2
3 changed files with 17 additions and 23 deletions

View file

@ -1228,7 +1228,7 @@ static inline void CL_DrawConnectionStatus(void)
cltext = M_GetText("Server full, waiting for a slot..."); cltext = M_GetText("Server full, waiting for a slot...");
else else
cltext = M_GetText("Requesting to join..."); cltext = M_GetText("Requesting to join...");
break; break;
#ifdef HAVE_CURL #ifdef HAVE_CURL
case CL_PREPAREHTTPFILES: case CL_PREPAREHTTPFILES:
@ -2029,7 +2029,7 @@ void CL_QueryServerList (msg_server_t *server_list)
static void M_ConfirmConnect(event_t *ev) static void M_ConfirmConnect(event_t *ev)
{ {
#ifndef NONET #ifndef NONET
if (ev->type == ev_keydown) if (ev->type == ev_keydown)
{ {
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[gc_accelerate][0] || ev->data1 == gamecontrol[gc_accelerate][1]) if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[gc_accelerate][0] || ev->data1 == gamecontrol[gc_accelerate][1])
@ -2052,7 +2052,7 @@ static void M_ConfirmConnect(event_t *ev)
} }
else else
cl_mode = CL_LOADFILES; cl_mode = CL_LOADFILES;
M_ClearMenus(true); M_ClearMenus(true);
} }
else if (ev->data1 == 'n' || ev->data1 == KEY_ESCAPE|| ev->data1 == gamecontrol[gc_brake][0] || ev->data1 == gamecontrol[gc_brake][1]) else if (ev->data1 == 'n' || ev->data1 == KEY_ESCAPE|| ev->data1 == gamecontrol[gc_brake][0] || ev->data1 == gamecontrol[gc_brake][1])
@ -2300,7 +2300,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
{ {
boolean waitmore; boolean waitmore;
INT32 i; INT32 i;
#ifdef NONET #ifdef NONET
(void)tmpsave; (void)tmpsave;
#endif #endif
@ -2337,7 +2337,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
{ {
curl_transfers++; curl_transfers++;
} }
cl_mode = CL_DOWNLOADHTTPFILES; cl_mode = CL_DOWNLOADHTTPFILES;
} }
break; break;
@ -5011,7 +5011,7 @@ FILESTAMP
{ {
node = (SINT8)doomcom->remotenode; node = (SINT8)doomcom->remotenode;
if (netbuffer->packettype == PT_CLIENTJOIN && server) if (netbuffer->packettype == PT_CLIENTJOIN && server && !levelloading)
{ {
HandleConnect(node); HandleConnect(node);
continue; continue;
@ -5222,7 +5222,7 @@ static void CL_SendClientKeepAlive(void)
static void SV_SendServerKeepAlive(void) static void SV_SendServerKeepAlive(void)
{ {
INT32 n; INT32 n;
for (n = 1; n < MAXNETNODES; n++) for (n = 1; n < MAXNETNODES; n++)
{ {
if (nodeingame[n]) if (nodeingame[n])
@ -5769,7 +5769,7 @@ FILESTAMP
{ {
SV_SendServerKeepAlive(); SV_SendServerKeepAlive();
} }
// No else because no tics are being run and we can't resynch during this // No else because no tics are being run and we can't resynch during this
Net_AckTicker(); Net_AckTicker();

View file

@ -1597,9 +1597,9 @@ void D_SRB2Main(void)
{ {
pagename = "TITLESKY"; pagename = "TITLESKY";
levelstarttic = gametic; levelstarttic = gametic;
G_SetGamestate(GS_LEVEL);
if (!P_SetupLevel(false)) if (!P_SetupLevel(false))
I_Quit(); // fail so reset game stuff I_Quit(); // fail so reset game stuff
G_SetGamestate(GS_LEVEL);
} }
#ifdef HAVE_DISCORDRPC #ifdef HAVE_DISCORDRPC

View file

@ -1733,20 +1733,6 @@ void G_DoLoadLevel(boolean resetplayer)
Y_EndIntermission(); Y_EndIntermission();
if (gamestate == GS_VOTING) if (gamestate == GS_VOTING)
Y_EndVote(); Y_EndVote();
// Don't allow people to download a partial/corrupted
// save while the server's loading the map/during the wipe.
// (this addresses "map" command usage, which means
// transitions/different gamestates would be skipped.)
if (gamestate == GS_LEVEL)
gamestate = GS_WAITINGPLAYERS;
// Setup the level.
if (!P_SetupLevel(false))
{
// fail so reset game stuff
Command_ExitGame_f();
return;
}
G_SetGamestate(GS_LEVEL); G_SetGamestate(GS_LEVEL);
@ -1756,6 +1742,14 @@ void G_DoLoadLevel(boolean resetplayer)
players[i].playerstate = PST_REBORN; players[i].playerstate = PST_REBORN;
} }
// Setup the level.
if (!P_SetupLevel(false))
{
// fail so reset game stuff
Command_ExitGame_f();
return;
}
if (!resetplayer) if (!resetplayer)
P_FindEmerald(); P_FindEmerald();