mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 20:41:25 +00:00
Fix NONET compiling
This commit is contained in:
parent
9a5bb59801
commit
1d7061b892
1 changed files with 42 additions and 32 deletions
|
@ -1836,8 +1836,6 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
||||||
#endif/*MASTERSERVER*/
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifndef NONET
|
|
||||||
|
|
||||||
static const char * InvalidServerReason (INT32 i)
|
static const char * InvalidServerReason (INT32 i)
|
||||||
{
|
{
|
||||||
#define EOT "\nPress ESC\n"
|
#define EOT "\nPress ESC\n"
|
||||||
|
@ -1904,6 +1902,8 @@ static const char * InvalidServerReason (INT32 i)
|
||||||
#undef EOT
|
#undef EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // ifndef NONET
|
||||||
|
|
||||||
/** Called by CL_ServerConnectionTicker
|
/** Called by CL_ServerConnectionTicker
|
||||||
*
|
*
|
||||||
* \param asksent The last time we asked the server to join. We re-ask every second in case our request got lost in transmit.
|
* \param asksent The last time we asked the server to join. We re-ask every second in case our request got lost in transmit.
|
||||||
|
@ -2932,6 +2932,34 @@ static void Command_Kick(void)
|
||||||
else
|
else
|
||||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Command_ResendGamestate(void)
|
||||||
|
{
|
||||||
|
SINT8 playernum;
|
||||||
|
|
||||||
|
if (COM_Argc() == 1)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("resendgamestate <playername/playernum>: resend the game state to a player\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (client)
|
||||||
|
{
|
||||||
|
CONS_Printf(M_GetText("Only the server can use this.\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
playernum = nametonum(COM_Argv(1));
|
||||||
|
if (playernum == -1 || playernum == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Send a PT_WILLRESENDGAMESTATE packet to the client so they know what's going on
|
||||||
|
netbuffer->packettype = PT_WILLRESENDGAMESTATE;
|
||||||
|
if (!HSendPacket(playernode[playernum], true, 0, 0))
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_ERROR, M_GetText("A problem occured, please try again.\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||||
|
@ -3139,34 +3167,6 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||||
CL_RemovePlayer(pnum, kickreason);
|
CL_RemovePlayer(pnum, kickreason);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Command_ResendGamestate(void)
|
|
||||||
{
|
|
||||||
SINT8 playernum;
|
|
||||||
|
|
||||||
if (COM_Argc() == 1)
|
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("resendgamestate <playername/playernum>: resend the game state to a player\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (client)
|
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("Only the server can use this.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
playernum = nametonum(COM_Argv(1));
|
|
||||||
if (playernum == -1 || playernum == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Send a PT_WILLRESENDGAMESTATE packet to the client so they know what's going on
|
|
||||||
netbuffer->packettype = PT_WILLRESENDGAMESTATE;
|
|
||||||
if (!HSendPacket(playernode[playernum], true, 0, 0))
|
|
||||||
{
|
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("A problem occured, please try again.\n"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_netticbuffer = CVAR_INIT ("netticbuffer", "1", CV_SAVE, netticbuffer_cons_t, NULL);
|
consvar_t cv_netticbuffer = CVAR_INIT ("netticbuffer", "1", CV_SAVE, netticbuffer_cons_t, NULL);
|
||||||
|
|
||||||
|
@ -3903,6 +3903,7 @@ static void HandleServerInfo(SINT8 node)
|
||||||
|
|
||||||
static void PT_WillResendGamestate(void)
|
static void PT_WillResendGamestate(void)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
char tmpsave[256];
|
char tmpsave[256];
|
||||||
|
|
||||||
if (server || cl_redownloadinggamestate)
|
if (server || cl_redownloadinggamestate)
|
||||||
|
@ -3925,10 +3926,12 @@ static void PT_WillResendGamestate(void)
|
||||||
CL_PrepareDownloadSaveGame(tmpsave);
|
CL_PrepareDownloadSaveGame(tmpsave);
|
||||||
|
|
||||||
cl_redownloadinggamestate = true;
|
cl_redownloadinggamestate = true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PT_CanReceiveGamestate(SINT8 node)
|
static void PT_CanReceiveGamestate(SINT8 node)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
if (client || sendingsavegame[node])
|
if (client || sendingsavegame[node])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -3936,6 +3939,9 @@ static void PT_CanReceiveGamestate(SINT8 node)
|
||||||
|
|
||||||
SV_SendSaveGame(node, true); // Resend a complete game state
|
SV_SendSaveGame(node, true); // Resend a complete game state
|
||||||
resendingsavegame[node] = true;
|
resendingsavegame[node] = true;
|
||||||
|
#else
|
||||||
|
(void)node;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handles a packet received from a node that isn't in game
|
/** Handles a packet received from a node that isn't in game
|
||||||
|
@ -4222,8 +4228,10 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
// Check player consistancy during the level
|
// Check player consistancy during the level
|
||||||
if (realstart <= gametic && realstart + BACKUPTICS - 1 > gametic && gamestate == GS_LEVEL
|
if (realstart <= gametic && realstart + BACKUPTICS - 1 > gametic && gamestate == GS_LEVEL
|
||||||
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy)
|
&& consistancy[realstart%BACKUPTICS] != SHORT(netbuffer->u.clientpak.consistancy)
|
||||||
&& !resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime()
|
#ifndef NONET
|
||||||
&& !SV_ResendingSavegameToAnyone())
|
&& !SV_ResendingSavegameToAnyone()
|
||||||
|
#endif
|
||||||
|
&& !resendingsavegame[node] && savegameresendcooldown[node] <= I_GetTime())
|
||||||
{
|
{
|
||||||
if (cv_resynchattempts.value)
|
if (cv_resynchattempts.value)
|
||||||
{
|
{
|
||||||
|
@ -5127,9 +5135,11 @@ void NetUpdate(void)
|
||||||
|
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
|
#ifndef NONET
|
||||||
// If the client just finished redownloading the game state, load it
|
// If the client just finished redownloading the game state, load it
|
||||||
if (cl_redownloadinggamestate && fileneeded[0].status == FS_FOUND)
|
if (cl_redownloadinggamestate && fileneeded[0].status == FS_FOUND)
|
||||||
CL_ReloadReceivedSavegame();
|
CL_ReloadReceivedSavegame();
|
||||||
|
#endif
|
||||||
|
|
||||||
CL_SendClientCmd(); // Send tic cmd
|
CL_SendClientCmd(); // Send tic cmd
|
||||||
hu_redownloadinggamestate = cl_redownloadinggamestate;
|
hu_redownloadinggamestate = cl_redownloadinggamestate;
|
||||||
|
|
Loading…
Reference in a new issue