mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 20:41:25 +00:00
Delete netcode
Just kidding, I just deleted NONET
This commit is contained in:
parent
e519f306fb
commit
05d232c029
18 changed files with 96 additions and 399 deletions
|
@ -64,7 +64,6 @@
|
||||||
#
|
#
|
||||||
# Netplay incompatible
|
# Netplay incompatible
|
||||||
# --------------------
|
# --------------------
|
||||||
# NONET=1 - Disable online capability.
|
|
||||||
# NOMD5=1 - Disable MD5 checksum (validation tool).
|
# NOMD5=1 - Disable MD5 checksum (validation tool).
|
||||||
# NOPOSTPROCESSING=1 - ?
|
# NOPOSTPROCESSING=1 - ?
|
||||||
# MOBJCONSISTANCY=1 - ??
|
# MOBJCONSISTANCY=1 - ??
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
passthru_opts+=\
|
passthru_opts+=\
|
||||||
NONET NO_IPV6 NOHW NOMD5 NOPOSTPROCESSING\
|
NO_IPV6 NOHW NOMD5 NOPOSTPROCESSING\
|
||||||
MOBJCONSISTANCY PACKETDROP ZDEBUG\
|
MOBJCONSISTANCY PACKETDROP ZDEBUG\
|
||||||
HAVE_MINIUPNPC\
|
HAVE_MINIUPNPC\
|
||||||
|
|
||||||
|
@ -46,13 +46,11 @@ sources+=apng.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef NONET
|
|
||||||
ifndef NOCURL
|
ifndef NOCURL
|
||||||
CURLCONFIG?=curl-config
|
CURLCONFIG?=curl-config
|
||||||
$(eval $(call Configure,CURL,$(CURLCONFIG)))
|
$(eval $(call Configure,CURL,$(CURLCONFIG)))
|
||||||
opts+=-DHAVE_CURL
|
opts+=-DHAVE_CURL
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef HAVE_MINIUPNPC
|
ifdef HAVE_MINIUPNPC
|
||||||
libs+=-lminiupnpc
|
libs+=-lminiupnpc
|
||||||
|
|
|
@ -35,12 +35,10 @@ libs+=-lws2_32
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef NONET
|
|
||||||
ifndef MINGW64 # miniupnc is broken with MINGW64
|
ifndef MINGW64 # miniupnc is broken with MINGW64
|
||||||
opts+=-I../libs -DSTATIC_MINIUPNPC
|
opts+=-I../libs -DSTATIC_MINIUPNPC
|
||||||
libs+=-L../libs/miniupnpc/mingw$(32) -lws2_32 -liphlpapi
|
libs+=-L../libs/miniupnpc/mingw$(32) -lws2_32 -liphlpapi
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef MINGW64
|
ifndef MINGW64
|
||||||
32=32
|
32=32
|
||||||
|
|
|
@ -53,12 +53,10 @@
|
||||||
// aaaaaa
|
// aaaaaa
|
||||||
#include "i_gamepad.h"
|
#include "i_gamepad.h"
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// cl loading screen
|
// cl loading screen
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "f_finale.h"
|
#include "f_finale.h"
|
||||||
#include "snake.h"
|
#include "snake.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// NETWORKING
|
// NETWORKING
|
||||||
|
@ -535,7 +533,6 @@ static cl_mode_t cl_mode = CL_SEARCHING;
|
||||||
|
|
||||||
static UINT16 cl_lastcheckedfilecount = 0; // used for full file list
|
static UINT16 cl_lastcheckedfilecount = 0; // used for full file list
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void *snake = NULL;
|
static void *snake = NULL;
|
||||||
|
|
||||||
static void CL_DrawConnectionStatusBox(void)
|
static void CL_DrawConnectionStatusBox(void)
|
||||||
|
@ -716,7 +713,6 @@ static inline void CL_DrawConnectionStatus(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static boolean CL_AskFileList(INT32 firstfile)
|
static boolean CL_AskFileList(INT32 firstfile)
|
||||||
{
|
{
|
||||||
|
@ -983,7 +979,6 @@ static boolean SV_SendServerConfig(INT32 node)
|
||||||
return waspacketsent;
|
return waspacketsent;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
#define SAVEGAMESIZE (768*1024)
|
#define SAVEGAMESIZE (768*1024)
|
||||||
|
|
||||||
static boolean SV_ResendingSavegameToAnyone(void)
|
static boolean SV_ResendingSavegameToAnyone(void)
|
||||||
|
@ -1210,9 +1205,7 @@ static void CL_ReloadReceivedSavegame(void)
|
||||||
|
|
||||||
CONS_Printf(M_GetText("Game state reloaded\n"));
|
CONS_Printf(M_GetText("Game state reloaded\n"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void SendAskInfo(INT32 node)
|
static void SendAskInfo(INT32 node)
|
||||||
{
|
{
|
||||||
const tic_t asktime = I_GetTime();
|
const tic_t asktime = I_GetTime();
|
||||||
|
@ -1430,12 +1423,8 @@ void CL_UpdateServerList(boolean internetsearch, INT32 room)
|
||||||
#endif/*MASTERSERVER*/
|
#endif/*MASTERSERVER*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // ifndef NONET
|
|
||||||
|
|
||||||
static void M_ConfirmConnect(event_t *ev)
|
static void M_ConfirmConnect(event_t *ev)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
if (ev->type == ev_keydown || ev->type == ev_gamepad_down)
|
if (ev->type == ev_keydown || ev->type == ev_gamepad_down)
|
||||||
{
|
{
|
||||||
if ((ev->type == ev_keydown && (ev->key == ' ' || ev->key == 'y' || ev->key == KEY_ENTER)) || (ev->type == ev_gamepad_down && ev->which == 0 && ev->key == GAMEPAD_BUTTON_A))
|
if ((ev->type == ev_keydown && (ev->key == ' ' || ev->key == 'y' || ev->key == KEY_ENTER)) || (ev->type == ev_gamepad_down && ev->which == 0 && ev->key == GAMEPAD_BUTTON_A))
|
||||||
|
@ -1459,9 +1448,6 @@ static void M_ConfirmConnect(event_t *ev)
|
||||||
M_ClearMenus(true);
|
M_ClearMenus(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
(void)ev;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean CL_FinishedFileList(void)
|
static boolean CL_FinishedFileList(void)
|
||||||
|
@ -1541,7 +1527,6 @@ static boolean CL_FinishedFileList(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
downloadcompletednum = 0;
|
downloadcompletednum = 0;
|
||||||
downloadcompletedsize = 0;
|
downloadcompletedsize = 0;
|
||||||
totalfilesrequestednum = 0;
|
totalfilesrequestednum = 0;
|
||||||
|
@ -1561,7 +1546,6 @@ static boolean CL_FinishedFileList(void)
|
||||||
downloadsize = Z_StrDup(va("%uM",totalfilesrequestedsize>>20));
|
downloadsize = Z_StrDup(va("%uM",totalfilesrequestedsize>>20));
|
||||||
else
|
else
|
||||||
downloadsize = Z_StrDup(va("%uK",totalfilesrequestedsize>>10));
|
downloadsize = Z_StrDup(va("%uK",totalfilesrequestedsize>>10));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (serverisfull)
|
if (serverisfull)
|
||||||
M_StartMessage(va(M_GetText(
|
M_StartMessage(va(M_GetText(
|
||||||
|
@ -1586,7 +1570,6 @@ static boolean CL_FinishedFileList(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static const char * InvalidServerReason (serverinfo_pak *info)
|
static const char * InvalidServerReason (serverinfo_pak *info)
|
||||||
{
|
{
|
||||||
#define EOT "\nPress ESC\n"
|
#define EOT "\nPress ESC\n"
|
||||||
|
@ -1650,7 +1633,6 @@ static const char * InvalidServerReason (serverinfo_pak *info)
|
||||||
|
|
||||||
#undef EOT
|
#undef EOT
|
||||||
}
|
}
|
||||||
#endif // ifndef NONET
|
|
||||||
|
|
||||||
/** Called by CL_ServerConnectionTicker
|
/** Called by CL_ServerConnectionTicker
|
||||||
*
|
*
|
||||||
|
@ -1662,7 +1644,6 @@ static const char * InvalidServerReason (serverinfo_pak *info)
|
||||||
*/
|
*/
|
||||||
static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
// serverlist is updated by GetPacket function
|
// serverlist is updated by GetPacket function
|
||||||
|
@ -1732,11 +1713,6 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
|
||||||
SendAskInfo(servernode);
|
SendAskInfo(servernode);
|
||||||
*asksent = I_GetTime();
|
*asksent = I_GetTime();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
(void)asksent;
|
|
||||||
// No netgames, so we skip this state.
|
|
||||||
cl_mode = CL_ASKJOIN;
|
|
||||||
#endif // ifndef NONET/else
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1756,10 +1732,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
boolean waitmore;
|
boolean waitmore;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
#ifdef NONET
|
|
||||||
(void)tmpsave;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (cl_mode)
|
switch (cl_mode)
|
||||||
{
|
{
|
||||||
case CL_SEARCHING:
|
case CL_SEARCHING:
|
||||||
|
@ -1824,12 +1796,12 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
), NULL, MM_NOTHING);
|
), NULL, MM_NOTHING);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifndef NONET
|
|
||||||
// prepare structures to save the file
|
// prepare structures to save the file
|
||||||
// WARNING: this can be useless in case of server not in GS_LEVEL
|
// WARNING: this can be useless in case of server not in GS_LEVEL
|
||||||
// but since the network layer doesn't provide ordered packets...
|
// but since the network layer doesn't provide ordered packets...
|
||||||
CL_PrepareDownloadSaveGame(tmpsave);
|
CL_PrepareDownloadSaveGame(tmpsave);
|
||||||
#endif
|
|
||||||
if (I_GetTime() >= *asksent && CL_SendJoin())
|
if (I_GetTime() >= *asksent && CL_SendJoin())
|
||||||
{
|
{
|
||||||
*asksent = I_GetTime() + NEWTICRATE*3;
|
*asksent = I_GetTime() + NEWTICRATE*3;
|
||||||
|
@ -1842,7 +1814,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
cl_mode = CL_ASKJOIN;
|
cl_mode = CL_ASKJOIN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifndef NONET
|
|
||||||
case CL_DOWNLOADSAVEGAME:
|
case CL_DOWNLOADSAVEGAME:
|
||||||
// At this state, the first (and only) needed file is the gamestate
|
// At this state, the first (and only) needed file is the gamestate
|
||||||
if (fileneeded[0].status == FS_FOUND)
|
if (fileneeded[0].status == FS_FOUND)
|
||||||
|
@ -1853,7 +1824,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
} // don't break case continue to CL_CONNECTED
|
} // don't break case continue to CL_CONNECTED
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case CL_CONNECTED:
|
case CL_CONNECTED:
|
||||||
case CL_CONFIRMCONNECT: //logic is handled by M_ConfirmConnect
|
case CL_CONFIRMCONNECT: //logic is handled by M_ConfirmConnect
|
||||||
|
@ -1898,10 +1868,8 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
memset(gamekeydown, 0, NUMKEYS);
|
memset(gamekeydown, 0, NUMKEYS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifndef NONET
|
|
||||||
else if (cl_mode == CL_DOWNLOADFILES && snake)
|
else if (cl_mode == CL_DOWNLOADFILES && snake)
|
||||||
Snake_Update(snake);
|
Snake_Update(snake);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (client && (cl_mode == CL_DOWNLOADFILES || cl_mode == CL_DOWNLOADSAVEGAME))
|
if (client && (cl_mode == CL_DOWNLOADFILES || cl_mode == CL_DOWNLOADSAVEGAME))
|
||||||
FileReceiveTicker();
|
FileReceiveTicker();
|
||||||
|
@ -1912,7 +1880,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
//FileSendTicker();
|
//FileSendTicker();
|
||||||
*oldtic = I_GetTime();
|
*oldtic = I_GetTime();
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
||||||
{
|
{
|
||||||
if (!snake)
|
if (!snake)
|
||||||
|
@ -1935,10 +1902,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
|
||||||
S_UpdateSounds();
|
S_UpdateSounds();
|
||||||
S_UpdateClosedCaptions();
|
S_UpdateClosedCaptions();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
CON_Drawer();
|
|
||||||
I_UpdateNoVsync();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1958,22 +1921,18 @@ static void CL_ConnectToServer(void)
|
||||||
{
|
{
|
||||||
INT32 pnumnodes, nodewaited = doomcom->numnodes, i;
|
INT32 pnumnodes, nodewaited = doomcom->numnodes, i;
|
||||||
tic_t oldtic;
|
tic_t oldtic;
|
||||||
#ifndef NONET
|
|
||||||
tic_t asksent;
|
tic_t asksent;
|
||||||
char tmpsave[256];
|
char tmpsave[256];
|
||||||
|
|
||||||
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
|
||||||
|
|
||||||
lastfilenum = -1;
|
lastfilenum = -1;
|
||||||
#endif
|
|
||||||
|
|
||||||
cl_mode = CL_SEARCHING;
|
cl_mode = CL_SEARCHING;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// Don't get a corrupt savegame error because tmpsave already exists
|
// Don't get a corrupt savegame error because tmpsave already exists
|
||||||
if (FIL_FileExists(tmpsave) && unlink(tmpsave) == -1)
|
if (FIL_FileExists(tmpsave) && unlink(tmpsave) == -1)
|
||||||
I_Error("Can't delete %s\n", tmpsave);
|
I_Error("Can't delete %s\n", tmpsave);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
{
|
{
|
||||||
|
@ -1994,7 +1953,6 @@ static void CL_ConnectToServer(void)
|
||||||
pnumnodes = 1;
|
pnumnodes = 1;
|
||||||
oldtic = I_GetTime() - 1;
|
oldtic = I_GetTime() - 1;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
asksent = (tic_t) - TICRATE;
|
asksent = (tic_t) - TICRATE;
|
||||||
firstconnectattempttime = I_GetTime();
|
firstconnectattempttime = I_GetTime();
|
||||||
|
|
||||||
|
@ -2010,16 +1968,11 @@ static void CL_ConnectToServer(void)
|
||||||
serverlist[i].info.version%100, serverlist[i].info.subversion);
|
serverlist[i].info.version%100, serverlist[i].info.subversion);
|
||||||
}
|
}
|
||||||
SL_ClearServerList(servernode);
|
SL_ClearServerList(servernode);
|
||||||
#endif
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// If the connection was aborted for some reason, leave
|
// If the connection was aborted for some reason, leave
|
||||||
#ifndef NONET
|
|
||||||
if (!CL_ServerConnectionTicker(tmpsave, &oldtic, &asksent))
|
if (!CL_ServerConnectionTicker(tmpsave, &oldtic, &asksent))
|
||||||
#else
|
|
||||||
if (!CL_ServerConnectionTicker((char*)NULL, &oldtic, (tic_t *)NULL))
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
|
@ -2037,7 +1990,6 @@ static void CL_ConnectToServer(void)
|
||||||
displayplayer = consoleplayer;
|
displayplayer = consoleplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
typedef struct banreason_s
|
typedef struct banreason_s
|
||||||
{
|
{
|
||||||
char *reason;
|
char *reason;
|
||||||
|
@ -2276,7 +2228,6 @@ static void Command_connect(void)
|
||||||
botskin = 0;
|
botskin = 0;
|
||||||
CL_ConnectToServer();
|
CL_ConnectToServer();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void ResetNode(INT32 node)
|
static void ResetNode(INT32 node)
|
||||||
{
|
{
|
||||||
|
@ -2437,10 +2388,8 @@ void CL_Reset(void)
|
||||||
FreeFileNeeded();
|
FreeFileNeeded();
|
||||||
fileneedednum = 0;
|
fileneedednum = 0;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
totalfilesrequestednum = 0;
|
totalfilesrequestednum = 0;
|
||||||
totalfilesrequestedsize = 0;
|
totalfilesrequestedsize = 0;
|
||||||
#endif
|
|
||||||
firstconnectattempttime = 0;
|
firstconnectattempttime = 0;
|
||||||
serverisfull = false;
|
serverisfull = false;
|
||||||
connectiontimeout = (tic_t)cv_nettimeout.value; //reset this temporary hack
|
connectiontimeout = (tic_t)cv_nettimeout.value; //reset this temporary hack
|
||||||
|
@ -2448,7 +2397,6 @@ void CL_Reset(void)
|
||||||
// D_StartTitle should get done now, but the calling function will handle it
|
// D_StartTitle should get done now, but the calling function will handle it
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void Command_GetPlayerNum(void)
|
static void Command_GetPlayerNum(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
@ -2726,7 +2674,6 @@ static void Command_ResendGamestate(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
|
@ -2810,10 +2757,8 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
|
||||||
{
|
{
|
||||||
if (I_Ban && !I_Ban(playernode[(INT32)pnum]))
|
if (I_Ban && !I_Ban(playernode[(INT32)pnum]))
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
|
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
|
||||||
#ifndef NONET
|
|
||||||
else
|
else
|
||||||
Ban_Add(reason);
|
Ban_Add(reason);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (msg)
|
switch (msg)
|
||||||
|
@ -2953,7 +2898,6 @@ void D_ClientServerInit(void)
|
||||||
DEBFILE(va("- - -== SRB2 v%d.%.2d.%d "VERSIONSTRING" debugfile ==- - -\n",
|
DEBFILE(va("- - -== SRB2 v%d.%.2d.%d "VERSIONSTRING" debugfile ==- - -\n",
|
||||||
VERSION/100, VERSION%100, SUBVERSION));
|
VERSION/100, VERSION%100, SUBVERSION));
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
COM_AddCommand("getplayernum", Command_GetPlayerNum);
|
||||||
COM_AddCommand("kick", Command_Kick);
|
COM_AddCommand("kick", Command_Kick);
|
||||||
COM_AddCommand("ban", Command_Ban);
|
COM_AddCommand("ban", Command_Ban);
|
||||||
|
@ -2970,17 +2914,14 @@ void D_ClientServerInit(void)
|
||||||
#endif
|
#endif
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
COM_AddCommand("numnodes", Command_Numnodes);
|
COM_AddCommand("numnodes", Command_Numnodes);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RegisterNetXCmd(XD_KICK, Got_KickCmd);
|
RegisterNetXCmd(XD_KICK, Got_KickCmd);
|
||||||
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
|
RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer);
|
||||||
#ifndef NONET
|
|
||||||
#ifdef DUMPCONSISTENCY
|
#ifdef DUMPCONSISTENCY
|
||||||
CV_RegisterVar(&cv_dumpconsistency);
|
CV_RegisterVar(&cv_dumpconsistency);
|
||||||
#endif
|
#endif
|
||||||
Ban_Load_File(false);
|
Ban_Load_File(false);
|
||||||
#endif
|
|
||||||
|
|
||||||
gametic = 0;
|
gametic = 0;
|
||||||
localgametic = 0;
|
localgametic = 0;
|
||||||
|
@ -3540,7 +3481,6 @@ static void HandleConnect(SINT8 node)
|
||||||
}
|
}
|
||||||
DEBFILE("new node joined\n");
|
DEBFILE("new node joined\n");
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
if (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)
|
if (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)
|
||||||
{
|
{
|
||||||
SV_SendSaveGame(node, false); // send a complete game state
|
SV_SendSaveGame(node, false); // send a complete game state
|
||||||
|
@ -3553,7 +3493,6 @@ static void HandleConnect(SINT8 node)
|
||||||
|
|
||||||
joindelay += cv_joindelay.value * TICRATE;
|
joindelay += cv_joindelay.value * TICRATE;
|
||||||
player_joining = true;
|
player_joining = true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when a PT_SERVERSHUTDOWN packet is received
|
/** Called when a PT_SERVERSHUTDOWN packet is received
|
||||||
|
@ -3586,7 +3525,6 @@ static void HandleTimeout(SINT8 node)
|
||||||
M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING);
|
M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
/** Called when a PT_SERVERINFO packet is received
|
/** Called when a PT_SERVERINFO packet is received
|
||||||
*
|
*
|
||||||
* \param node The packet sender
|
* \param node The packet sender
|
||||||
|
@ -3608,7 +3546,6 @@ static void HandleServerInfo(SINT8 node)
|
||||||
|
|
||||||
SL_InsertServer(&netbuffer->u.serverinfo, node);
|
SL_InsertServer(&netbuffer->u.serverinfo, node);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Helper function for packets that should only be sent by the server
|
// Helper function for packets that should only be sent by the server
|
||||||
// If it is NOT from the server, bail out and close the connection!
|
// If it is NOT from the server, bail out and close the connection!
|
||||||
|
@ -3744,14 +3681,9 @@ static void PT_ServerCFG(SINT8 node)
|
||||||
playernode[(UINT8)serverplayer] = servernode;
|
playernode[(UINT8)serverplayer] = servernode;
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
#ifndef NONET
|
|
||||||
CONS_Printf(M_GetText("Join accepted, waiting for complete game state...\n"));
|
CONS_Printf(M_GetText("Join accepted, waiting for complete game state...\n"));
|
||||||
#else
|
|
||||||
CONS_Printf(M_GetText("Join accepted, waiting for next level change...\n"));
|
|
||||||
#endif
|
|
||||||
DEBFILE(va("Server accept join gametic=%u mynode=%d\n", gametic, mynode));
|
DEBFILE(va("Server accept join gametic=%u mynode=%d\n", gametic, mynode));
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
|
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
|
||||||
/// Shouldn't them be downloaded even at intermission time?
|
/// Shouldn't them be downloaded even at intermission time?
|
||||||
/// Also, according to HandleConnect, the server will send the savegame even during intermission...
|
/// Also, according to HandleConnect, the server will send the savegame even during intermission...
|
||||||
|
@ -3759,7 +3691,6 @@ static void PT_ServerCFG(SINT8 node)
|
||||||
netbuffer->u.servercfg.gamestate == GS_INTERMISSION*/)
|
netbuffer->u.servercfg.gamestate == GS_INTERMISSION*/)
|
||||||
cl_mode = CL_DOWNLOADSAVEGAME;
|
cl_mode = CL_DOWNLOADSAVEGAME;
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
cl_mode = CL_CONNECTED;
|
cl_mode = CL_CONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3823,9 +3754,7 @@ static void PT_ClientCmd(SINT8 node, INT32 netconsole)
|
||||||
// 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)
|
||||||
#ifndef NONET
|
|
||||||
&& !SV_ResendingSavegameToAnyone()
|
&& !SV_ResendingSavegameToAnyone()
|
||||||
#endif
|
|
||||||
&& !netnodes[node].resendingsavegame && netnodes[node].savegameresendcooldown <= I_GetTime())
|
&& !netnodes[node].resendingsavegame && netnodes[node].savegameresendcooldown <= I_GetTime())
|
||||||
{
|
{
|
||||||
if (cv_resynchattempts.value)
|
if (cv_resynchattempts.value)
|
||||||
|
@ -4000,7 +3929,6 @@ static void PT_ClientQuit(SINT8 node, INT32 netconsole)
|
||||||
|
|
||||||
static void PT_CanReceiveGamestate(SINT8 node)
|
static void PT_CanReceiveGamestate(SINT8 node)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
if (client || netnodes[node].sendingsavegame)
|
if (client || netnodes[node].sendingsavegame)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -4008,9 +3936,6 @@ static void PT_CanReceiveGamestate(SINT8 node)
|
||||||
|
|
||||||
SV_SendSaveGame(node, true); // Resend a complete game state
|
SV_SendSaveGame(node, true); // Resend a complete game state
|
||||||
netnodes[node].resendingsavegame = true;
|
netnodes[node].resendingsavegame = true;
|
||||||
#else
|
|
||||||
(void)node;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PT_AskLuaFile(SINT8 node)
|
static void PT_AskLuaFile(SINT8 node)
|
||||||
|
@ -4134,7 +4059,6 @@ static void PT_WillResendGamestate(SINT8 node)
|
||||||
{
|
{
|
||||||
(void)node;
|
(void)node;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
char tmpsave[256];
|
char tmpsave[256];
|
||||||
|
|
||||||
if (server || cl_redownloadinggamestate)
|
if (server || cl_redownloadinggamestate)
|
||||||
|
@ -4157,7 +4081,6 @@ static void PT_WillResendGamestate(SINT8 node)
|
||||||
CL_PrepareDownloadSaveGame(tmpsave);
|
CL_PrepareDownloadSaveGame(tmpsave);
|
||||||
|
|
||||||
cl_redownloadinggamestate = true;
|
cl_redownloadinggamestate = true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PT_SendingLuaFile(SINT8 node)
|
static void PT_SendingLuaFile(SINT8 node)
|
||||||
|
@ -4296,13 +4219,11 @@ static void GetPackets(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
if (netbuffer->packettype == PT_SERVERINFO)
|
if (netbuffer->packettype == PT_SERVERINFO)
|
||||||
{
|
{
|
||||||
HandleServerInfo(node);
|
HandleServerInfo(node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (netbuffer->packettype == PT_PLAYERINFO)
|
if (netbuffer->packettype == PT_PLAYERINFO)
|
||||||
continue; // We do nothing with PLAYERINFO, that's for the MS browser.
|
continue; // We do nothing with PLAYERINFO, that's for the MS browser.
|
||||||
|
@ -4906,11 +4827,9 @@ 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;
|
||||||
|
|
|
@ -437,11 +437,9 @@ boolean TryRunTics(tic_t realtic);
|
||||||
/*boolean AddLmpExtradata(UINT8 **demo_p, INT32 playernum);
|
/*boolean AddLmpExtradata(UINT8 **demo_p, INT32 playernum);
|
||||||
void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum);*/
|
void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum);*/
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// translate a playername in a player number return -1 if not found and
|
// translate a playername in a player number return -1 if not found and
|
||||||
// print a error message in the console
|
// print a error message in the console
|
||||||
SINT8 nametonum(const char *name);
|
SINT8 nametonum(const char *name);
|
||||||
#endif
|
|
||||||
|
|
||||||
extern char motd[254], server_context[8];
|
extern char motd[254], server_context[8];
|
||||||
extern UINT8 playernode[MAXPLAYERS];
|
extern UINT8 playernode[MAXPLAYERS];
|
||||||
|
|
48
src/d_net.c
48
src/d_net.c
|
@ -138,7 +138,6 @@ boolean Net_GetNetStat(void)
|
||||||
#define URGENTFREESLOTNUM 10
|
#define URGENTFREESLOTNUM 10
|
||||||
#define ACKTOSENDTIMEOUT (TICRATE/11)
|
#define ACKTOSENDTIMEOUT (TICRATE/11)
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 acknum;
|
UINT8 acknum;
|
||||||
|
@ -152,7 +151,6 @@ typedef struct
|
||||||
doomdata_t data;
|
doomdata_t data;
|
||||||
} pak;
|
} pak;
|
||||||
} ackpak_t;
|
} ackpak_t;
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -160,10 +158,8 @@ typedef enum
|
||||||
NF_TIMEOUT = 2, // Flag is set when the node got a timeout
|
NF_TIMEOUT = 2, // Flag is set when the node got a timeout
|
||||||
} node_flags_t;
|
} node_flags_t;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// Table of packets that were not acknowleged can be resent (the sender window)
|
// Table of packets that were not acknowleged can be resent (the sender window)
|
||||||
static ackpak_t ackpak[MAXACKPACKETS];
|
static ackpak_t ackpak[MAXACKPACKETS];
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -191,7 +187,6 @@ typedef struct
|
||||||
static node_t nodes[MAXNETNODES];
|
static node_t nodes[MAXNETNODES];
|
||||||
#define NODETIMEOUT 14
|
#define NODETIMEOUT 14
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// return <0 if a < b (mod 256)
|
// return <0 if a < b (mod 256)
|
||||||
// 0 if a = n (mod 256)
|
// 0 if a = n (mod 256)
|
||||||
// >0 if a > b (mod 256)
|
// >0 if a > b (mod 256)
|
||||||
|
@ -426,21 +421,15 @@ static boolean Processackpak(void)
|
||||||
}
|
}
|
||||||
return goodpacket;
|
return goodpacket;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// send special packet with only ack on it
|
// send special packet with only ack on it
|
||||||
void Net_SendAcks(INT32 node)
|
void Net_SendAcks(INT32 node)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)node;
|
|
||||||
#else
|
|
||||||
netbuffer->packettype = PT_NOTHING;
|
netbuffer->packettype = PT_NOTHING;
|
||||||
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
|
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
|
||||||
HSendPacket(node, false, 0, MAXACKTOSEND);
|
HSendPacket(node, false, 0, MAXACKTOSEND);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void GotAcks(void)
|
static void GotAcks(void)
|
||||||
{
|
{
|
||||||
INT32 i, j;
|
INT32 i, j;
|
||||||
|
@ -463,7 +452,6 @@ static void GotAcks(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void Net_ConnectionTimeout(INT32 node)
|
void Net_ConnectionTimeout(INT32 node)
|
||||||
{
|
{
|
||||||
|
@ -489,7 +477,6 @@ void Net_ConnectionTimeout(INT32 node)
|
||||||
// Resend the data if needed
|
// Resend the data if needed
|
||||||
void Net_AckTicker(void)
|
void Net_AckTicker(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
for (i = 0; i < MAXACKPACKETS; i++)
|
for (i = 0; i < MAXACKPACKETS; i++)
|
||||||
|
@ -536,16 +523,12 @@ void Net_AckTicker(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove last packet received ack before resending the ackreturn
|
// Remove last packet received ack before resending the ackreturn
|
||||||
// (the higher layer doesn't have room, or something else ....)
|
// (the higher layer doesn't have room, or something else ....)
|
||||||
void Net_UnAcknowledgePacket(INT32 node)
|
void Net_UnAcknowledgePacket(INT32 node)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)node;
|
|
||||||
#else
|
|
||||||
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
|
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
|
||||||
DEBFILE(va("UnAcknowledge node %d\n", node));
|
DEBFILE(va("UnAcknowledge node %d\n", node));
|
||||||
if (!node)
|
if (!node)
|
||||||
|
@ -577,10 +560,8 @@ void Net_UnAcknowledgePacket(INT32 node)
|
||||||
if (!nodes[node].firstacktosend)
|
if (!nodes[node].firstacktosend)
|
||||||
nodes[node].firstacktosend = 1;
|
nodes[node].firstacktosend = 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
/** Checks if all acks have been received
|
/** Checks if all acks have been received
|
||||||
*
|
*
|
||||||
* \return True if all acks have been received
|
* \return True if all acks have been received
|
||||||
|
@ -596,7 +577,6 @@ static boolean Net_AllAcksReceived(void)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Waits for all ackreturns
|
/** Waits for all ackreturns
|
||||||
*
|
*
|
||||||
|
@ -605,9 +585,6 @@ static boolean Net_AllAcksReceived(void)
|
||||||
*/
|
*/
|
||||||
void Net_WaitAllAckReceived(UINT32 timeout)
|
void Net_WaitAllAckReceived(UINT32 timeout)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)timeout;
|
|
||||||
#else
|
|
||||||
tic_t tictac = I_GetTime();
|
tic_t tictac = I_GetTime();
|
||||||
timeout = tictac + timeout*NEWTICRATE;
|
timeout = tictac + timeout*NEWTICRATE;
|
||||||
|
|
||||||
|
@ -623,7 +600,6 @@ void Net_WaitAllAckReceived(UINT32 timeout)
|
||||||
HGetPacket();
|
HGetPacket();
|
||||||
Net_AckTicker();
|
Net_AckTicker();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InitNode(node_t *node)
|
static void InitNode(node_t *node)
|
||||||
|
@ -639,10 +615,8 @@ static void InitAck(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
for (i = 0; i < MAXACKPACKETS; i++)
|
for (i = 0; i < MAXACKPACKETS; i++)
|
||||||
ackpak[i].acknum = 0;
|
ackpak[i].acknum = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < MAXNETNODES; i++)
|
for (i = 0; i < MAXNETNODES; i++)
|
||||||
InitNode(&nodes[i]);
|
InitNode(&nodes[i]);
|
||||||
|
@ -655,9 +629,6 @@ static void InitAck(void)
|
||||||
*/
|
*/
|
||||||
void Net_AbortPacketType(UINT8 packettype)
|
void Net_AbortPacketType(UINT8 packettype)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)packettype;
|
|
||||||
#else
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
for (i = 0; i < MAXACKPACKETS; i++)
|
for (i = 0; i < MAXACKPACKETS; i++)
|
||||||
if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype
|
if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype
|
||||||
|
@ -665,7 +636,6 @@ void Net_AbortPacketType(UINT8 packettype)
|
||||||
{
|
{
|
||||||
ackpak[i].acknum = 0;
|
ackpak[i].acknum = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
@ -675,9 +645,6 @@ void Net_AbortPacketType(UINT8 packettype)
|
||||||
// remove a node, clear all ack from this node and reset askret
|
// remove a node, clear all ack from this node and reset askret
|
||||||
void Net_CloseConnection(INT32 node)
|
void Net_CloseConnection(INT32 node)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)node;
|
|
||||||
#else
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
boolean forceclose = (node & FORCECLOSE) != 0;
|
boolean forceclose = (node & FORCECLOSE) != 0;
|
||||||
|
|
||||||
|
@ -722,10 +689,8 @@ void Net_CloseConnection(INT32 node)
|
||||||
if (server)
|
if (server)
|
||||||
SV_AbortLuaFileTransfer(node);
|
SV_AbortLuaFileTransfer(node);
|
||||||
I_NetFreeNodenum(node);
|
I_NetFreeNodenum(node);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
//
|
//
|
||||||
// Checksum
|
// Checksum
|
||||||
//
|
//
|
||||||
|
@ -741,7 +706,6 @@ static UINT32 NetbufferChecksum(void)
|
||||||
|
|
||||||
return LONG(c);
|
return LONG(c);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEBUGFILE
|
#ifdef DEBUGFILE
|
||||||
|
|
||||||
|
@ -983,14 +947,12 @@ void Command_Droprate(void)
|
||||||
packetdroprate = droprate;
|
packetdroprate = droprate;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static boolean ShouldDropPacket(void)
|
static boolean ShouldDropPacket(void)
|
||||||
{
|
{
|
||||||
return (packetdropquantity[netbuffer->packettype])
|
return (packetdropquantity[netbuffer->packettype])
|
||||||
|| (packetdroprate != 0 && rand() < (RAND_MAX * (packetdroprate / 100.f))) || packetdroprate == 100;
|
|| (packetdroprate != 0 && rand() < (RAND_MAX * (packetdroprate / 100.f))) || packetdroprate == 100;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// HSendPacket
|
// HSendPacket
|
||||||
|
@ -1025,11 +987,6 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
||||||
if (!netgame)
|
if (!netgame)
|
||||||
I_Error("Tried to transmit to another node");
|
I_Error("Tried to transmit to another node");
|
||||||
|
|
||||||
#ifdef NONET
|
|
||||||
(void)node;
|
|
||||||
(void)reliable;
|
|
||||||
(void)acknum;
|
|
||||||
#else
|
|
||||||
// do this before GetFreeAcknum because this function backups
|
// do this before GetFreeAcknum because this function backups
|
||||||
// the current packet
|
// the current packet
|
||||||
doomcom->remotenode = (INT16)node;
|
doomcom->remotenode = (INT16)node;
|
||||||
|
@ -1090,8 +1047,6 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // ndef NONET
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1125,8 +1080,6 @@ boolean HGetPacket(void)
|
||||||
if (!netgame)
|
if (!netgame)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
//nodejustjoined = I_NetGet();
|
//nodejustjoined = I_NetGet();
|
||||||
|
@ -1186,7 +1139,6 @@ boolean HGetPacket(void)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif // ndef NONET
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum,
|
||||||
size_t packetlength);
|
size_t packetlength);
|
||||||
boolean HGetPacket(void);
|
boolean HGetPacket(void);
|
||||||
void D_SetDoomcom(void);
|
void D_SetDoomcom(void);
|
||||||
#ifndef NONET
|
|
||||||
void D_SaveBan(void);
|
void D_SaveBan(void);
|
||||||
#endif
|
|
||||||
boolean D_CheckNetGame(void);
|
boolean D_CheckNetGame(void);
|
||||||
void D_CloseConnection(void);
|
void D_CloseConnection(void);
|
||||||
void Net_UnAcknowledgePacket(INT32 node);
|
void Net_UnAcknowledgePacket(INT32 node);
|
||||||
|
|
|
@ -628,11 +628,9 @@ void D_RegisterServerCommands(void)
|
||||||
CV_RegisterVar(&cv_maxsend);
|
CV_RegisterVar(&cv_maxsend);
|
||||||
CV_RegisterVar(&cv_noticedownload);
|
CV_RegisterVar(&cv_noticedownload);
|
||||||
CV_RegisterVar(&cv_downloadspeed);
|
CV_RegisterVar(&cv_downloadspeed);
|
||||||
#ifndef NONET
|
|
||||||
CV_RegisterVar(&cv_allownewplayer);
|
CV_RegisterVar(&cv_allownewplayer);
|
||||||
CV_RegisterVar(&cv_showjoinaddress);
|
CV_RegisterVar(&cv_showjoinaddress);
|
||||||
CV_RegisterVar(&cv_blamecfail);
|
CV_RegisterVar(&cv_blamecfail);
|
||||||
#endif
|
|
||||||
|
|
||||||
COM_AddCommand("ping", Command_Ping_f);
|
COM_AddCommand("ping", Command_Ping_f);
|
||||||
CV_RegisterVar(&cv_nettimeout);
|
CV_RegisterVar(&cv_nettimeout);
|
||||||
|
|
|
@ -103,14 +103,12 @@ typedef struct
|
||||||
} pauseddownload_t;
|
} pauseddownload_t;
|
||||||
static pauseddownload_t *pauseddownload = NULL;
|
static pauseddownload_t *pauseddownload = NULL;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// for cl loading screen
|
// for cl loading screen
|
||||||
INT32 lastfilenum = -1;
|
INT32 lastfilenum = -1;
|
||||||
INT32 downloadcompletednum = 0;
|
INT32 downloadcompletednum = 0;
|
||||||
UINT32 downloadcompletedsize = 0;
|
UINT32 downloadcompletedsize = 0;
|
||||||
INT32 totalfilesrequestednum = 0;
|
INT32 totalfilesrequestednum = 0;
|
||||||
UINT32 totalfilesrequestedsize = 0;
|
UINT32 totalfilesrequestedsize = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
luafiletransfer_t *luafiletransfers = NULL;
|
luafiletransfer_t *luafiletransfers = NULL;
|
||||||
boolean waitingforluafiletransfer = false;
|
boolean waitingforluafiletransfer = false;
|
||||||
|
@ -250,9 +248,7 @@ void D_ParseFileneeded(INT32 fileneedednum_parm, UINT8 *fileneededstr, UINT16 fi
|
||||||
|
|
||||||
void CL_PrepareDownloadSaveGame(const char *tmpsave)
|
void CL_PrepareDownloadSaveGame(const char *tmpsave)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
lastfilenum = -1;
|
lastfilenum = -1;
|
||||||
#endif
|
|
||||||
|
|
||||||
FreeFileNeeded();
|
FreeFileNeeded();
|
||||||
AllocFileNeeded(1);
|
AllocFileNeeded(1);
|
||||||
|
@ -1466,9 +1462,7 @@ void PT_FileFragment(SINT8 node, INT32 netconsole)
|
||||||
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
|
I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
lastfilenum = filenum;
|
lastfilenum = filenum;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Checks if a node is downloading a file
|
/** \brief Checks if a node is downloading a file
|
||||||
|
|
|
@ -70,13 +70,11 @@ extern INT32 fileneedednum;
|
||||||
extern fileneeded_t *fileneeded;
|
extern fileneeded_t *fileneeded;
|
||||||
extern char downloaddir[512];
|
extern char downloaddir[512];
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
extern INT32 lastfilenum;
|
extern INT32 lastfilenum;
|
||||||
extern INT32 downloadcompletednum;
|
extern INT32 downloadcompletednum;
|
||||||
extern UINT32 downloadcompletedsize;
|
extern UINT32 downloadcompletedsize;
|
||||||
extern INT32 totalfilesrequestednum;
|
extern INT32 totalfilesrequestednum;
|
||||||
extern UINT32 totalfilesrequestedsize;
|
extern UINT32 totalfilesrequestedsize;
|
||||||
#endif
|
|
||||||
|
|
||||||
void AllocFileNeeded(INT32 size);
|
void AllocFileNeeded(INT32 size);
|
||||||
void FreeFileNeeded(void);
|
void FreeFileNeeded(void);
|
||||||
|
|
|
@ -4831,7 +4831,7 @@ const char *const MENUTYPES_LIST[] = {
|
||||||
"MP_SERVER",
|
"MP_SERVER",
|
||||||
"MP_CONNECT",
|
"MP_CONNECT",
|
||||||
"MP_ROOM",
|
"MP_ROOM",
|
||||||
"MP_PLAYERSETUP", // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
"MP_PLAYERSETUP",
|
||||||
"MP_SERVER_OPTIONS",
|
"MP_SERVER_OPTIONS",
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#define NONET
|
|
||||||
#if !defined (HWRENDER) && !defined (NOHW)
|
#if !defined (HWRENDER) && !defined (NOHW)
|
||||||
#define HWRENDER
|
#define HWRENDER
|
||||||
#endif
|
#endif
|
||||||
|
@ -657,7 +656,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
||||||
/// Maintain compatibility with older 2.2 demos
|
/// Maintain compatibility with older 2.2 demos
|
||||||
#define OLD22DEMOCOMPAT
|
#define OLD22DEMOCOMPAT
|
||||||
|
|
||||||
#if defined (HAVE_CURL) && ! defined (NONET)
|
#ifdef HAVE_CURL
|
||||||
#define MASTERSERVER
|
#define MASTERSERVER
|
||||||
#else
|
#else
|
||||||
#undef UPDATE_ALERT
|
#undef UPDATE_ALERT
|
||||||
|
|
|
@ -175,14 +175,12 @@ static huddrawlist_h luahuddrawlist_scores;
|
||||||
|
|
||||||
static tic_t resynch_ticker = 0;
|
static tic_t resynch_ticker = 0;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// just after
|
// just after
|
||||||
static void Command_Say_f(void);
|
static void Command_Say_f(void);
|
||||||
static void Command_Sayto_f(void);
|
static void Command_Sayto_f(void);
|
||||||
static void Command_Sayteam_f(void);
|
static void Command_Sayteam_f(void);
|
||||||
static void Command_CSay_f(void);
|
static void Command_CSay_f(void);
|
||||||
static void Got_Saycmd(UINT8 **p, INT32 playernum);
|
static void Got_Saycmd(UINT8 **p, INT32 playernum);
|
||||||
#endif
|
|
||||||
|
|
||||||
void HU_LoadGraphics(void)
|
void HU_LoadGraphics(void)
|
||||||
{
|
{
|
||||||
|
@ -327,13 +325,11 @@ void HU_LoadGraphics(void)
|
||||||
//
|
//
|
||||||
void HU_Init(void)
|
void HU_Init(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
COM_AddCommand("say", Command_Say_f);
|
COM_AddCommand("say", Command_Say_f);
|
||||||
COM_AddCommand("sayto", Command_Sayto_f);
|
COM_AddCommand("sayto", Command_Sayto_f);
|
||||||
COM_AddCommand("sayteam", Command_Sayteam_f);
|
COM_AddCommand("sayteam", Command_Sayteam_f);
|
||||||
COM_AddCommand("csay", Command_CSay_f);
|
COM_AddCommand("csay", Command_CSay_f);
|
||||||
RegisterNetXCmd(XD_SAY, Got_Saycmd);
|
RegisterNetXCmd(XD_SAY, Got_Saycmd);
|
||||||
#endif
|
|
||||||
|
|
||||||
// set shift translation table
|
// set shift translation table
|
||||||
shiftxform = english_shiftxform;
|
shiftxform = english_shiftxform;
|
||||||
|
@ -363,8 +359,6 @@ void HU_Start(void)
|
||||||
// EXECUTION
|
// EXECUTION
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
// EVERY CHANGE IN THIS SCRIPT IS LOL XD! BY VINCYTM
|
// EVERY CHANGE IN THIS SCRIPT IS LOL XD! BY VINCYTM
|
||||||
|
|
||||||
static UINT32 chat_nummsg_log = 0;
|
static UINT32 chat_nummsg_log = 0;
|
||||||
|
@ -412,11 +406,9 @@ static void HU_removeChatText_Log(void)
|
||||||
}
|
}
|
||||||
chat_nummsg_log--; // lost 1 msg.
|
chat_nummsg_log--; // lost 1 msg.
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void HU_AddChatText(const char *text, boolean playsound)
|
void HU_AddChatText(const char *text, boolean playsound)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
if (playsound && cv_consolechat.value != 2) // Don't play the sound if we're using hidden chat.
|
if (playsound && cv_consolechat.value != 2) // Don't play the sound if we're using hidden chat.
|
||||||
S_StartSound(NULL, sfx_radio);
|
S_StartSound(NULL, sfx_radio);
|
||||||
// reguardless of our preferences, put all of this in the chat buffer in case we decide to change from oldchat mid-game.
|
// reguardless of our preferences, put all of this in the chat buffer in case we decide to change from oldchat mid-game.
|
||||||
|
@ -438,14 +430,8 @@ void HU_AddChatText(const char *text, boolean playsound)
|
||||||
CONS_Printf("%s\n", text);
|
CONS_Printf("%s\n", text);
|
||||||
else // if we aren't, still save the message to log.txt
|
else // if we aren't, still save the message to log.txt
|
||||||
CON_LogMessage(va("%s\n", text));
|
CON_LogMessage(va("%s\n", text));
|
||||||
#else
|
|
||||||
(void)playsound;
|
|
||||||
CONS_Printf("%s\n", text);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
/** Runs a say command, sending an ::XD_SAY message.
|
/** Runs a say command, sending an ::XD_SAY message.
|
||||||
* A say command consists of a signed 8-bit integer for the target, an
|
* A say command consists of a signed 8-bit integer for the target, an
|
||||||
* unsigned 8-bit flag variable, and then the message itself.
|
* unsigned 8-bit flag variable, and then the message itself.
|
||||||
|
@ -865,8 +851,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
void HU_Ticker(void)
|
void HU_Ticker(void)
|
||||||
|
@ -882,7 +866,6 @@ void HU_Ticker(void)
|
||||||
else
|
else
|
||||||
hu_showscores = false;
|
hu_showscores = false;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
if (chat_on)
|
if (chat_on)
|
||||||
{
|
{
|
||||||
// count down the scroll timer.
|
// count down the scroll timer.
|
||||||
|
@ -910,7 +893,6 @@ void HU_Ticker(void)
|
||||||
HU_removeChatText_Mini();
|
HU_removeChatText_Mini();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (cechotimer > 0) --cechotimer;
|
if (cechotimer > 0) --cechotimer;
|
||||||
|
|
||||||
|
@ -918,8 +900,6 @@ void HU_Ticker(void)
|
||||||
resynch_ticker++;
|
resynch_ticker++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
static boolean teamtalk = false;
|
static boolean teamtalk = false;
|
||||||
static boolean justscrolleddown;
|
static boolean justscrolleddown;
|
||||||
static boolean justscrolledup;
|
static boolean justscrolledup;
|
||||||
|
@ -1027,8 +1007,6 @@ static void HU_sendChatMessage(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void HU_clearChatChars(void)
|
void HU_clearChatChars(void)
|
||||||
{
|
{
|
||||||
memset(w_chat, '\0', sizeof(w_chat));
|
memset(w_chat, '\0', sizeof(w_chat));
|
||||||
|
@ -1043,16 +1021,13 @@ void HU_clearChatChars(void)
|
||||||
//
|
//
|
||||||
boolean HU_Responder(event_t *ev)
|
boolean HU_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
INT32 c=0;
|
INT32 c=0;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ev->type != ev_keydown)
|
if (ev->type != ev_keydown)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// only KeyDown events now...
|
// only KeyDown events now...
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
c = (INT32)ev->key;
|
c = (INT32)ev->key;
|
||||||
|
|
||||||
if (!chat_on)
|
if (!chat_on)
|
||||||
|
@ -1202,7 +1177,6 @@ boolean HU_Responder(event_t *ev)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1212,8 +1186,6 @@ boolean HU_Responder(event_t *ev)
|
||||||
// HEADS UP DRAWING
|
// HEADS UP DRAWING
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
// Precompile a wordwrapped string to any given width.
|
// Precompile a wordwrapped string to any given width.
|
||||||
// This is a muuuch better method than V_WORDWRAP.
|
// This is a muuuch better method than V_WORDWRAP.
|
||||||
// again stolen and modified a bit from video.c, don't mind me, will need to rearrange this one day.
|
// again stolen and modified a bit from video.c, don't mind me, will need to rearrange this one day.
|
||||||
|
@ -1793,7 +1765,6 @@ static void HU_DrawChat_Old(void)
|
||||||
if (hu_tick < 4)
|
if (hu_tick < 4)
|
||||||
V_DrawCharacter(HU_INPUTX + c, y, '_' | cv_constextsize.value |V_NOSCALESTART|t, true);
|
V_DrawCharacter(HU_INPUTX + c, y, '_' | cv_constextsize.value |V_NOSCALESTART|t, true);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// Draw crosshairs at the exact center of the view.
|
// Draw crosshairs at the exact center of the view.
|
||||||
// In splitscreen, crosshairs are stretched vertically to compensate for V_PERPLAYER squishing them.
|
// In splitscreen, crosshairs are stretched vertically to compensate for V_PERPLAYER squishing them.
|
||||||
|
@ -1933,7 +1904,6 @@ static void HU_DrawDemoInfo(void)
|
||||||
//
|
//
|
||||||
void HU_Drawer(void)
|
void HU_Drawer(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
// draw chat string plus cursor
|
// draw chat string plus cursor
|
||||||
if (chat_on)
|
if (chat_on)
|
||||||
{
|
{
|
||||||
|
@ -1950,7 +1920,6 @@ void HU_Drawer(void)
|
||||||
if (!OLDCHAT && cv_consolechat.value < 2 && netgame) // Don't display minimized chat if you set the mode to Window (Hidden)
|
if (!OLDCHAT && cv_consolechat.value < 2 && netgame) // Don't display minimized chat if you set the mode to Window (Hidden)
|
||||||
HU_drawMiniChat(); // draw messages in a cool fashion.
|
HU_drawMiniChat(); // draw messages in a cool fashion.
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (cechotimer)
|
if (cechotimer)
|
||||||
HU_DrawCEcho();
|
HU_DrawCEcho();
|
||||||
|
|
110
src/i_tcp.c
110
src/i_tcp.c
|
@ -38,16 +38,9 @@
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
|
|
||||||
#if defined (NOMD5) && !defined (NONET)
|
#ifdef USE_WINSOCK1
|
||||||
//#define NONET
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NONET
|
|
||||||
#undef HAVE_MINIUPNPC
|
|
||||||
#else
|
|
||||||
#ifdef USE_WINSOCK1
|
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#else
|
#else
|
||||||
#ifndef USE_WINSOCK
|
#ifndef USE_WINSOCK
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#ifdef __APPLE_CC__
|
#ifdef __APPLE_CC__
|
||||||
|
@ -67,9 +60,9 @@
|
||||||
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
|
#if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON)
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif // UNIXCOMMON
|
#endif // UNIXCOMMON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
// some undefined under win32
|
// some undefined under win32
|
||||||
#undef errno
|
#undef errno
|
||||||
//#define errno WSAGetLastError() //Alam_GBC: this is the correct way, right?
|
//#define errno WSAGetLastError() //Alam_GBC: this is the correct way, right?
|
||||||
|
@ -105,18 +98,18 @@
|
||||||
#ifndef STATUS_INVALID_PARAMETER
|
#ifndef STATUS_INVALID_PARAMETER
|
||||||
#define STATUS_INVALID_PARAMETER 0xC000000D
|
#define STATUS_INVALID_PARAMETER 0xC000000D
|
||||||
#endif
|
#endif
|
||||||
#endif // USE_WINSOCK
|
#endif // USE_WINSOCK
|
||||||
|
|
||||||
typedef union
|
typedef union
|
||||||
{
|
{
|
||||||
struct sockaddr any;
|
struct sockaddr any;
|
||||||
struct sockaddr_in ip4;
|
struct sockaddr_in ip4;
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
struct sockaddr_in6 ip6;
|
struct sockaddr_in6 ip6;
|
||||||
#endif
|
#endif
|
||||||
} mysockaddr_t;
|
} mysockaddr_t;
|
||||||
|
|
||||||
#ifdef HAVE_MINIUPNPC
|
#ifdef HAVE_MINIUPNPC
|
||||||
#ifdef STATIC_MINIUPNPC
|
#ifdef STATIC_MINIUPNPC
|
||||||
#define STATICLIB
|
#define STATICLIB
|
||||||
#endif
|
#endif
|
||||||
|
@ -125,9 +118,7 @@
|
||||||
#include "miniupnpc/upnpcommands.h"
|
#include "miniupnpc/upnpcommands.h"
|
||||||
#undef STATICLIB
|
#undef STATICLIB
|
||||||
static UINT8 UPNP_support = TRUE;
|
static UINT8 UPNP_support = TRUE;
|
||||||
#endif // HAVE_MINIUPNC
|
#endif // HAVE_MINIUPNC
|
||||||
|
|
||||||
#endif // !NONET
|
|
||||||
|
|
||||||
#define MAXBANS 100
|
#define MAXBANS 100
|
||||||
|
|
||||||
|
@ -151,7 +142,7 @@
|
||||||
#define SELECTTEST
|
#define SELECTTEST
|
||||||
#define DEFAULTPORT "5029"
|
#define DEFAULTPORT "5029"
|
||||||
|
|
||||||
#if defined (USE_WINSOCK) && !defined (NONET)
|
#ifdef USE_WINSOCK
|
||||||
typedef SOCKET SOCKET_TYPE;
|
typedef SOCKET SOCKET_TYPE;
|
||||||
#define ERRSOCKET (SOCKET_ERROR)
|
#define ERRSOCKET (SOCKET_ERROR)
|
||||||
#else
|
#else
|
||||||
|
@ -163,22 +154,20 @@
|
||||||
#define ERRSOCKET (-1)
|
#define ERRSOCKET (-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NONET
|
// define socklen_t in DOS/Windows if it is not already defined
|
||||||
// define socklen_t in DOS/Windows if it is not already defined
|
#ifdef USE_WINSOCK1
|
||||||
#ifdef USE_WINSOCK1
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#endif
|
|
||||||
static SOCKET_TYPE mysockets[MAXNETNODES+1] = {ERRSOCKET};
|
|
||||||
static size_t mysocketses = 0;
|
|
||||||
static int myfamily[MAXNETNODES+1] = {0};
|
|
||||||
static SOCKET_TYPE nodesocket[MAXNETNODES+1] = {ERRSOCKET};
|
|
||||||
static mysockaddr_t clientaddress[MAXNETNODES+1];
|
|
||||||
static mysockaddr_t broadcastaddress[MAXNETNODES+1];
|
|
||||||
static size_t broadcastaddresses = 0;
|
|
||||||
static boolean nodeconnected[MAXNETNODES+1];
|
|
||||||
static mysockaddr_t banned[MAXBANS];
|
|
||||||
static UINT8 bannedmask[MAXBANS];
|
|
||||||
#endif
|
#endif
|
||||||
|
static SOCKET_TYPE mysockets[MAXNETNODES+1] = {ERRSOCKET};
|
||||||
|
static size_t mysocketses = 0;
|
||||||
|
static int myfamily[MAXNETNODES+1] = {0};
|
||||||
|
static SOCKET_TYPE nodesocket[MAXNETNODES+1] = {ERRSOCKET};
|
||||||
|
static mysockaddr_t clientaddress[MAXNETNODES+1];
|
||||||
|
static mysockaddr_t broadcastaddress[MAXNETNODES+1];
|
||||||
|
static size_t broadcastaddresses = 0;
|
||||||
|
static boolean nodeconnected[MAXNETNODES+1];
|
||||||
|
static mysockaddr_t banned[MAXBANS];
|
||||||
|
static UINT8 bannedmask[MAXBANS];
|
||||||
|
|
||||||
static size_t numbans = 0;
|
static size_t numbans = 0;
|
||||||
static boolean SOCK_bannednode[MAXNETNODES+1]; /// \note do we really need the +1?
|
static boolean SOCK_bannednode[MAXNETNODES+1]; /// \note do we really need the +1?
|
||||||
|
@ -187,7 +176,6 @@ static boolean init_tcp_driver = false;
|
||||||
static const char *serverport_name = DEFAULTPORT;
|
static const char *serverport_name = DEFAULTPORT;
|
||||||
static const char *clientport_name;/* any port */
|
static const char *clientport_name;/* any port */
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
// stupid microsoft makes things complicated
|
// stupid microsoft makes things complicated
|
||||||
static char *get_WSAErrorStr(int e)
|
static char *get_WSAErrorStr(int e)
|
||||||
|
@ -374,47 +362,33 @@ static const char *SOCK_AddrToStr(mysockaddr_t *sk)
|
||||||
#endif
|
#endif
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char *SOCK_GetNodeAddress(INT32 node)
|
static const char *SOCK_GetNodeAddress(INT32 node)
|
||||||
{
|
{
|
||||||
if (node == 0)
|
if (node == 0)
|
||||||
return "self";
|
return "self";
|
||||||
#ifdef NONET
|
|
||||||
return NULL;
|
|
||||||
#else
|
|
||||||
if (!nodeconnected[node])
|
if (!nodeconnected[node])
|
||||||
return NULL;
|
return NULL;
|
||||||
return SOCK_AddrToStr(&clientaddress[node]);
|
return SOCK_AddrToStr(&clientaddress[node]);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *SOCK_GetBanAddress(size_t ban)
|
static const char *SOCK_GetBanAddress(size_t ban)
|
||||||
{
|
{
|
||||||
if (ban >= numbans)
|
if (ban >= numbans)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef NONET
|
|
||||||
return NULL;
|
|
||||||
#else
|
|
||||||
return SOCK_AddrToStr(&banned[ban]);
|
return SOCK_AddrToStr(&banned[ban]);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *SOCK_GetBanMask(size_t ban)
|
static const char *SOCK_GetBanMask(size_t ban)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)ban;
|
|
||||||
#else
|
|
||||||
static char s[16]; //255.255.255.255 netmask? no, just CDIR for only
|
static char s[16]; //255.255.255.255 netmask? no, just CDIR for only
|
||||||
if (ban >= numbans)
|
if (ban >= numbans)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (sprintf(s,"%d",bannedmask[ban]) > 0)
|
if (sprintf(s,"%d",bannedmask[ban]) > 0)
|
||||||
return s;
|
return s;
|
||||||
#endif
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
|
static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
|
||||||
{
|
{
|
||||||
UINT32 bitmask = INADDR_NONE;
|
UINT32 bitmask = INADDR_NONE;
|
||||||
|
@ -518,9 +492,7 @@ void Command_Numnodes(void)
|
||||||
connected, ingame);
|
connected, ingame);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// Returns true if a packet was received from a new node, false in all other cases
|
// Returns true if a packet was received from a new node, false in all other cases
|
||||||
static boolean SOCK_Get(void)
|
static boolean SOCK_Get(void)
|
||||||
{
|
{
|
||||||
|
@ -583,10 +555,8 @@ static boolean SOCK_Get(void)
|
||||||
doomcom->remotenode = -1; // no packet
|
doomcom->remotenode = -1; // no packet
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// check if we can send (do not go over the buffer)
|
// check if we can send (do not go over the buffer)
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
static fd_set masterset;
|
static fd_set masterset;
|
||||||
|
|
||||||
|
@ -636,9 +606,7 @@ static boolean SOCK_CanGet(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr)
|
static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr)
|
||||||
{
|
{
|
||||||
socklen_t d4 = (socklen_t)sizeof(struct sockaddr_in);
|
socklen_t d4 = (socklen_t)sizeof(struct sockaddr_in);
|
||||||
|
@ -701,9 +669,7 @@ static void SOCK_Send(void)
|
||||||
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void SOCK_FreeNodenum(INT32 numnode)
|
static void SOCK_FreeNodenum(INT32 numnode)
|
||||||
{
|
{
|
||||||
// can't disconnect from self :)
|
// can't disconnect from self :)
|
||||||
|
@ -718,12 +684,10 @@ static void SOCK_FreeNodenum(INT32 numnode)
|
||||||
// put invalid address
|
// put invalid address
|
||||||
memset(&clientaddress[numnode], 0, sizeof (clientaddress[numnode]));
|
memset(&clientaddress[numnode], 0, sizeof (clientaddress[numnode]));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// UDPsocket
|
// UDPsocket
|
||||||
//
|
//
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
// allocate a socket
|
// allocate a socket
|
||||||
static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen)
|
static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen)
|
||||||
|
@ -1044,12 +1008,10 @@ static boolean UDP_Socket(void)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
boolean I_InitTcpDriver(void)
|
boolean I_InitTcpDriver(void)
|
||||||
{
|
{
|
||||||
boolean tcp_was_up = init_tcp_driver;
|
boolean tcp_was_up = init_tcp_driver;
|
||||||
#ifndef NONET
|
|
||||||
if (!init_tcp_driver)
|
if (!init_tcp_driver)
|
||||||
{
|
{
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
|
@ -1104,7 +1066,7 @@ boolean I_InitTcpDriver(void)
|
||||||
#endif
|
#endif
|
||||||
init_tcp_driver = true;
|
init_tcp_driver = true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if (!tcp_was_up && init_tcp_driver)
|
if (!tcp_was_up && init_tcp_driver)
|
||||||
{
|
{
|
||||||
I_AddExitFunc(I_ShutdownTcpDriver);
|
I_AddExitFunc(I_ShutdownTcpDriver);
|
||||||
|
@ -1118,7 +1080,6 @@ boolean I_InitTcpDriver(void)
|
||||||
return init_tcp_driver;
|
return init_tcp_driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void SOCK_CloseSocket(void)
|
static void SOCK_CloseSocket(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -1133,11 +1094,9 @@ static void SOCK_CloseSocket(void)
|
||||||
mysockets[i] = ERRSOCKET;
|
mysockets[i] = ERRSOCKET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void I_ShutdownTcpDriver(void)
|
void I_ShutdownTcpDriver(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
SOCK_CloseSocket();
|
SOCK_CloseSocket();
|
||||||
|
|
||||||
CONS_Printf("I_ShutdownTcpDriver: ");
|
CONS_Printf("I_ShutdownTcpDriver: ");
|
||||||
|
@ -1147,10 +1106,8 @@ void I_ShutdownTcpDriver(void)
|
||||||
#endif
|
#endif
|
||||||
CONS_Printf("shut down\n");
|
CONS_Printf("shut down\n");
|
||||||
init_tcp_driver = false;
|
init_tcp_driver = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
|
static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
|
||||||
{
|
{
|
||||||
SINT8 newnode = -1;
|
SINT8 newnode = -1;
|
||||||
|
@ -1194,11 +1151,9 @@ static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port)
|
||||||
I_freeaddrinfo(ai);
|
I_freeaddrinfo(ai);
|
||||||
return newnode;
|
return newnode;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static boolean SOCK_OpenSocket(void)
|
static boolean SOCK_OpenSocket(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
memset(clientaddress, 0, sizeof (clientaddress));
|
memset(clientaddress, 0, sizeof (clientaddress));
|
||||||
|
@ -1222,18 +1177,12 @@ static boolean SOCK_OpenSocket(void)
|
||||||
// build the socket but close it first
|
// build the socket but close it first
|
||||||
SOCK_CloseSocket();
|
SOCK_CloseSocket();
|
||||||
return UDP_Socket();
|
return UDP_Socket();
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean SOCK_Ban(INT32 node)
|
static boolean SOCK_Ban(INT32 node)
|
||||||
{
|
{
|
||||||
if (node > MAXNETNODES)
|
if (node > MAXNETNODES)
|
||||||
return false;
|
return false;
|
||||||
#ifdef NONET
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
if (numbans == MAXBANS)
|
if (numbans == MAXBANS)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1252,16 +1201,10 @@ static boolean SOCK_Ban(INT32 node)
|
||||||
#endif
|
#endif
|
||||||
numbans++;
|
numbans++;
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean SOCK_SetBanAddress(const char *address, const char *mask)
|
static boolean SOCK_SetBanAddress(const char *address, const char *mask)
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
(void)address;
|
|
||||||
(void)mask;
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
struct my_addrinfo *ai, *runp, hints;
|
struct my_addrinfo *ai, *runp, hints;
|
||||||
int gaie;
|
int gaie;
|
||||||
|
|
||||||
|
@ -1306,7 +1249,6 @@ static boolean SOCK_SetBanAddress(const char *address, const char *mask)
|
||||||
I_freeaddrinfo(ai);
|
I_freeaddrinfo(ai);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SOCK_ClearBans(void)
|
static void SOCK_ClearBans(void)
|
||||||
|
|
55
src/m_menu.c
55
src/m_menu.c
|
@ -147,9 +147,7 @@ static struct
|
||||||
INT32 index;
|
INT32 index;
|
||||||
} gamepadInfo[MAX_CONNECTED_GAMEPADS + 1];
|
} gamepadInfo[MAX_CONNECTED_GAMEPADS + 1];
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static UINT32 serverlistpage;
|
static UINT32 serverlistpage;
|
||||||
#endif
|
|
||||||
|
|
||||||
static UINT8 numsaves = 0;
|
static UINT8 numsaves = 0;
|
||||||
static saveinfo_t* savegameinfo = NULL; // Extra info about the save games.
|
static saveinfo_t* savegameinfo = NULL; // Extra info about the save games.
|
||||||
|
@ -189,10 +187,8 @@ static void M_GoBack(INT32 choice);
|
||||||
static void M_StopMessage(INT32 choice);
|
static void M_StopMessage(INT32 choice);
|
||||||
static boolean stopstopmessage = false;
|
static boolean stopstopmessage = false;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void M_HandleServerPage(INT32 choice);
|
static void M_HandleServerPage(INT32 choice);
|
||||||
static void M_RoomMenu(INT32 choice);
|
static void M_RoomMenu(INT32 choice);
|
||||||
#endif
|
|
||||||
|
|
||||||
// Prototyping is fun, innit?
|
// Prototyping is fun, innit?
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
@ -294,7 +290,6 @@ static void M_SetupMultiPlayer2(INT32 choice);
|
||||||
static void M_StartSplitServerMenu(INT32 choice);
|
static void M_StartSplitServerMenu(INT32 choice);
|
||||||
static void M_StartServer(INT32 choice);
|
static void M_StartServer(INT32 choice);
|
||||||
static void M_ServerOptions(INT32 choice);
|
static void M_ServerOptions(INT32 choice);
|
||||||
#ifndef NONET
|
|
||||||
static void M_StartServerMenu(INT32 choice);
|
static void M_StartServerMenu(INT32 choice);
|
||||||
static void M_ConnectMenu(INT32 choice);
|
static void M_ConnectMenu(INT32 choice);
|
||||||
static void M_ConnectMenuModChecks(INT32 choice);
|
static void M_ConnectMenuModChecks(INT32 choice);
|
||||||
|
@ -302,7 +297,6 @@ static void M_Refresh(INT32 choice);
|
||||||
static void M_Connect(INT32 choice);
|
static void M_Connect(INT32 choice);
|
||||||
static void M_ChooseRoom(INT32 choice);
|
static void M_ChooseRoom(INT32 choice);
|
||||||
menu_t MP_MainDef;
|
menu_t MP_MainDef;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
// Split into multiple parts due to size
|
// Split into multiple parts due to size
|
||||||
|
@ -381,11 +375,9 @@ static void M_DrawVideoMode(void);
|
||||||
static void M_DrawColorMenu(void);
|
static void M_DrawColorMenu(void);
|
||||||
static void M_DrawScreenshotMenu(void);
|
static void M_DrawScreenshotMenu(void);
|
||||||
static void M_DrawMonitorToggles(void);
|
static void M_DrawMonitorToggles(void);
|
||||||
#ifndef NONET
|
|
||||||
static void M_DrawConnectMenu(void);
|
static void M_DrawConnectMenu(void);
|
||||||
static void M_DrawMPMainMenu(void);
|
static void M_DrawMPMainMenu(void);
|
||||||
static void M_DrawRoomMenu(void);
|
static void M_DrawRoomMenu(void);
|
||||||
#endif
|
|
||||||
static void M_DrawGamepadList(void);
|
static void M_DrawGamepadList(void);
|
||||||
static void M_DrawSetupMultiPlayerMenu(void);
|
static void M_DrawSetupMultiPlayerMenu(void);
|
||||||
|
|
||||||
|
@ -399,10 +391,8 @@ static void M_HandleImageDef(INT32 choice);
|
||||||
static void M_HandleLoadSave(INT32 choice);
|
static void M_HandleLoadSave(INT32 choice);
|
||||||
static void M_HandleLevelStats(INT32 choice);
|
static void M_HandleLevelStats(INT32 choice);
|
||||||
static void M_HandlePlaystyleMenu(INT32 choice);
|
static void M_HandlePlaystyleMenu(INT32 choice);
|
||||||
#ifndef NONET
|
|
||||||
static boolean M_CancelConnect(void);
|
static boolean M_CancelConnect(void);
|
||||||
static void M_HandleConnectIP(INT32 choice);
|
static void M_HandleConnectIP(INT32 choice);
|
||||||
#endif
|
|
||||||
static void M_HandleSetupMultiPlayer(INT32 choice);
|
static void M_HandleSetupMultiPlayer(INT32 choice);
|
||||||
static void M_HandleVideoMode(INT32 choice);
|
static void M_HandleVideoMode(INT32 choice);
|
||||||
|
|
||||||
|
@ -501,11 +491,7 @@ consvar_t cv_dummyloadless = CVAR_INIT ("dummyloadless", "In-game", CV_HIDEN, lo
|
||||||
static menuitem_t MainMenu[] =
|
static menuitem_t MainMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING|IT_CALL, NULL, "1 Player", M_SinglePlayerMenu, 76},
|
{IT_STRING|IT_CALL, NULL, "1 Player", M_SinglePlayerMenu, 76},
|
||||||
#ifndef NONET
|
|
||||||
{IT_STRING|IT_SUBMENU, NULL, "Multiplayer", &MP_MainDef, 84},
|
{IT_STRING|IT_SUBMENU, NULL, "Multiplayer", &MP_MainDef, 84},
|
||||||
#else
|
|
||||||
{IT_STRING|IT_CALL, NULL, "Multiplayer", M_StartSplitServerMenu, 84},
|
|
||||||
#endif
|
|
||||||
{IT_STRING|IT_CALL, NULL, "Extras", M_SecretsMenu, 92},
|
{IT_STRING|IT_CALL, NULL, "Extras", M_SecretsMenu, 92},
|
||||||
{IT_CALL |IT_STRING, NULL, "Addons", M_Addons, 100},
|
{IT_CALL |IT_STRING, NULL, "Addons", M_Addons, 100},
|
||||||
{IT_STRING|IT_CALL, NULL, "Options", M_Options, 108},
|
{IT_STRING|IT_CALL, NULL, "Options", M_Options, 108},
|
||||||
|
@ -956,16 +942,10 @@ static menuitem_t SP_PlayerMenu[] =
|
||||||
static menuitem_t MP_SplitServerMenu[] =
|
static menuitem_t MP_SplitServerMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING|IT_CALL, NULL, "Select Gametype/Level...", M_MapChange, 100},
|
{IT_STRING|IT_CALL, NULL, "Select Gametype/Level...", M_MapChange, 100},
|
||||||
#ifdef NONET // In order to keep player setup accessible.
|
|
||||||
{IT_STRING|IT_CALL, NULL, "Player 1 setup...", M_SetupMultiPlayer, 110},
|
|
||||||
{IT_STRING|IT_CALL, NULL, "Player 2 setup...", M_SetupMultiPlayer2, 120},
|
|
||||||
#endif
|
|
||||||
{IT_STRING|IT_CALL, NULL, "More Options...", M_ServerOptions, 130},
|
{IT_STRING|IT_CALL, NULL, "More Options...", M_ServerOptions, 130},
|
||||||
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 140},
|
{IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 140},
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
static menuitem_t MP_MainMenu[] =
|
static menuitem_t MP_MainMenu[] =
|
||||||
{
|
{
|
||||||
{IT_HEADER, NULL, "Join a game", NULL, 0},
|
{IT_HEADER, NULL, "Join a game", NULL, 0},
|
||||||
|
@ -1052,8 +1032,6 @@ menuitem_t MP_RoomMenu[] =
|
||||||
{IT_DISABLED, NULL, "", M_ChooseRoom, 162},
|
{IT_DISABLED, NULL, "", M_ChooseRoom, 162},
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static menuitem_t MP_PlayerSetupMenu[] =
|
static menuitem_t MP_PlayerSetupMenu[] =
|
||||||
{
|
{
|
||||||
{IT_KEYHANDLER, NULL, "", M_HandleSetupMultiPlayer, 0}, // name
|
{IT_KEYHANDLER, NULL, "", M_HandleSetupMultiPlayer, 0}, // name
|
||||||
|
@ -1612,14 +1590,12 @@ enum
|
||||||
static menuitem_t OP_ServerOptionsMenu[] =
|
static menuitem_t OP_ServerOptionsMenu[] =
|
||||||
{
|
{
|
||||||
{IT_HEADER, NULL, "General", NULL, 0},
|
{IT_HEADER, NULL, "General", NULL, 0},
|
||||||
#ifndef NONET
|
|
||||||
{IT_STRING | IT_CVAR | IT_CV_STRING,
|
{IT_STRING | IT_CVAR | IT_CV_STRING,
|
||||||
NULL, "Server name", &cv_servername, 7},
|
NULL, "Server name", &cv_servername, 7},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 21},
|
{IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 21},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Allow Add-on Downloading", &cv_downloading, 26},
|
{IT_STRING | IT_CVAR, NULL, "Allow Add-on Downloading", &cv_downloading, 26},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 31},
|
{IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 31},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Minutes for reconnecting", &cv_rejointimeout, 36},
|
{IT_STRING | IT_CVAR, NULL, "Minutes for reconnecting", &cv_rejointimeout, 36},
|
||||||
#endif
|
|
||||||
{IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 41},
|
{IT_STRING | IT_CVAR, NULL, "Map progression", &cv_advancemap, 41},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 46},
|
{IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 46},
|
||||||
|
|
||||||
|
@ -1658,7 +1634,6 @@ static menuitem_t OP_ServerOptionsMenu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Autobalance sizes", &cv_autobalance, 216},
|
{IT_STRING | IT_CVAR, NULL, "Autobalance sizes", &cv_autobalance, 216},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Scramble on Map Change", &cv_scrambleonchange, 221},
|
{IT_STRING | IT_CVAR, NULL, "Scramble on Map Change", &cv_scrambleonchange, 221},
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
{IT_HEADER, NULL, "Advanced", NULL, 230},
|
{IT_HEADER, NULL, "Advanced", NULL, 230},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 236},
|
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 236},
|
||||||
|
|
||||||
|
@ -1666,7 +1641,6 @@ static menuitem_t OP_ServerOptionsMenu[] =
|
||||||
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 256},
|
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 256},
|
||||||
|
|
||||||
{IT_STRING | IT_CVAR, NULL, "Show IP Address of Joiners", &cv_showjoinaddress, 261},
|
{IT_STRING | IT_CVAR, NULL, "Show IP Address of Joiners", &cv_showjoinaddress, 261},
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static menuitem_t OP_MonitorToggleMenu[] =
|
static menuitem_t OP_MonitorToggleMenu[] =
|
||||||
|
@ -1976,11 +1950,7 @@ menu_t MP_SplitServerDef =
|
||||||
MTREE2(MN_MP_MAIN, MN_MP_SPLITSCREEN),
|
MTREE2(MN_MP_MAIN, MN_MP_SPLITSCREEN),
|
||||||
"M_MULTI",
|
"M_MULTI",
|
||||||
sizeof (MP_SplitServerMenu)/sizeof (menuitem_t),
|
sizeof (MP_SplitServerMenu)/sizeof (menuitem_t),
|
||||||
#ifndef NONET
|
|
||||||
&MP_MainDef,
|
&MP_MainDef,
|
||||||
#else
|
|
||||||
&MainDef,
|
|
||||||
#endif
|
|
||||||
MP_SplitServerMenu,
|
MP_SplitServerMenu,
|
||||||
M_DrawServerMenu,
|
M_DrawServerMenu,
|
||||||
27, 30 - 50,
|
27, 30 - 50,
|
||||||
|
@ -1988,8 +1958,6 @@ menu_t MP_SplitServerDef =
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
|
|
||||||
menu_t MP_MainDef =
|
menu_t MP_MainDef =
|
||||||
{
|
{
|
||||||
MN_MP_MAIN,
|
MN_MP_MAIN,
|
||||||
|
@ -2041,15 +2009,10 @@ menu_t MP_RoomDef =
|
||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
menu_t MP_PlayerSetupDef =
|
menu_t MP_PlayerSetupDef =
|
||||||
{
|
{
|
||||||
#ifdef NONET
|
|
||||||
MTREE2(MN_MP_MAIN, MN_MP_PLAYERSETUP),
|
|
||||||
#else
|
|
||||||
MTREE3(MN_MP_MAIN, MN_MP_SPLITSCREEN, MN_MP_PLAYERSETUP),
|
MTREE3(MN_MP_MAIN, MN_MP_SPLITSCREEN, MN_MP_PLAYERSETUP),
|
||||||
#endif
|
|
||||||
"M_SPLAYR",
|
"M_SPLAYR",
|
||||||
sizeof (MP_PlayerSetupMenu)/sizeof (menuitem_t),
|
sizeof (MP_PlayerSetupMenu)/sizeof (menuitem_t),
|
||||||
&MainDef, // doesn't matter
|
&MainDef, // doesn't matter
|
||||||
|
@ -3991,9 +3954,7 @@ void M_Init(void)
|
||||||
OP_GamepadSetMenu[i].itemaction = M_AssignGamepad;
|
OP_GamepadSetMenu[i].itemaction = M_AssignGamepad;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
CV_RegisterVar(&cv_serversort);
|
CV_RegisterVar(&cv_serversort);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void M_InitCharacterTables(void)
|
void M_InitCharacterTables(void)
|
||||||
|
@ -11006,7 +10967,6 @@ static void M_EndGame(INT32 choice)
|
||||||
|
|
||||||
#define S_LINEY(n) currentMenu->y + SERVERHEADERHEIGHT + (n * SERVERLINEHEIGHT)
|
#define S_LINEY(n) currentMenu->y + SERVERHEADERHEIGHT + (n * SERVERLINEHEIGHT)
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static UINT32 localservercount;
|
static UINT32 localservercount;
|
||||||
|
|
||||||
static void M_HandleServerPage(INT32 choice)
|
static void M_HandleServerPage(INT32 choice)
|
||||||
|
@ -11278,11 +11238,9 @@ static int ServerListEntryComparator_modified(const void *entry1, const void *en
|
||||||
// Default to strcmp.
|
// Default to strcmp.
|
||||||
return strcmp(sa->info.servername, sb->info.servername);
|
return strcmp(sa->info.servername, sb->info.servername);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void M_SortServerList(void)
|
void M_SortServerList(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
switch(cv_serversort.value)
|
switch(cv_serversort.value)
|
||||||
{
|
{
|
||||||
case 0: // Ping.
|
case 0: // Ping.
|
||||||
|
@ -11304,10 +11262,8 @@ void M_SortServerList(void)
|
||||||
qsort(serverlist, serverlistcount, sizeof(serverelem_t), ServerListEntryComparator_gametypename);
|
qsort(serverlist, serverlistcount, sizeof(serverelem_t), ServerListEntryComparator_gametypename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
#ifdef UPDATE_ALERT
|
#ifdef UPDATE_ALERT
|
||||||
static boolean M_CheckMODVersion(int id)
|
static boolean M_CheckMODVersion(int id)
|
||||||
{
|
{
|
||||||
|
@ -11506,7 +11462,6 @@ static void M_ChooseRoom(INT32 choice)
|
||||||
if (currentMenu == &MP_ConnectDef)
|
if (currentMenu == &MP_ConnectDef)
|
||||||
M_Refresh(0);
|
M_Refresh(0);
|
||||||
}
|
}
|
||||||
#endif //NONET
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
// Start Server Menu
|
// Start Server Menu
|
||||||
|
@ -11554,7 +11509,6 @@ static void M_DrawServerMenu(void)
|
||||||
{
|
{
|
||||||
M_DrawGenericMenu();
|
M_DrawGenericMenu();
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
// Room name
|
// Room name
|
||||||
if (currentMenu == &MP_ServerDef)
|
if (currentMenu == &MP_ServerDef)
|
||||||
{
|
{
|
||||||
|
@ -11566,15 +11520,10 @@ static void M_DrawServerMenu(void)
|
||||||
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey,
|
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey,
|
||||||
V_YELLOWMAP, room_list[menuRoomIndex].name);
|
V_YELLOWMAP, room_list[menuRoomIndex].name);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (cv_nextmap.value)
|
if (cv_nextmap.value)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
#define imgheight MP_ServerMenu[mp_server_levelgt].alphaKey
|
#define imgheight MP_ServerMenu[mp_server_levelgt].alphaKey
|
||||||
#else
|
|
||||||
#define imgheight 100
|
|
||||||
#endif
|
|
||||||
patch_t *PictureOfLevel;
|
patch_t *PictureOfLevel;
|
||||||
lumpnum_t lumpnum;
|
lumpnum_t lumpnum;
|
||||||
char headerstr[40];
|
char headerstr[40];
|
||||||
|
@ -11626,7 +11575,6 @@ static void M_ServerOptions(INT32 choice)
|
||||||
{
|
{
|
||||||
(void)choice;
|
(void)choice;
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
if ((splitscreen && !netgame) || currentMenu == &MP_SplitServerDef)
|
if ((splitscreen && !netgame) || currentMenu == &MP_SplitServerDef)
|
||||||
{
|
{
|
||||||
OP_ServerOptionsMenu[ 1].status = IT_GRAYEDOUT; // Server name
|
OP_ServerOptionsMenu[ 1].status = IT_GRAYEDOUT; // Server name
|
||||||
|
@ -11647,7 +11595,6 @@ static void M_ServerOptions(INT32 choice)
|
||||||
OP_ServerOptionsMenu[37].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[37].status = IT_STRING | IT_CVAR;
|
||||||
OP_ServerOptionsMenu[38].status = IT_STRING | IT_CVAR;
|
OP_ServerOptionsMenu[38].status = IT_STRING | IT_CVAR;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Disable fading because of different menu head. */
|
/* Disable fading because of different menu head. */
|
||||||
if (currentMenu == &OP_MainDef)/* from Options menu */
|
if (currentMenu == &OP_MainDef)/* from Options menu */
|
||||||
|
@ -11659,7 +11606,6 @@ static void M_ServerOptions(INT32 choice)
|
||||||
M_SetupNextMenu(&OP_ServerOptionsDef);
|
M_SetupNextMenu(&OP_ServerOptionsDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void M_StartServerMenu(INT32 choice)
|
static void M_StartServerMenu(INT32 choice)
|
||||||
{
|
{
|
||||||
(void)choice;
|
(void)choice;
|
||||||
|
@ -11870,7 +11816,6 @@ static void M_HandleConnectIP(INT32 choice)
|
||||||
M_ClearMenus(true);
|
M_ClearMenus(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //!NONET
|
|
||||||
|
|
||||||
// ========================
|
// ========================
|
||||||
// MULTIPLAYER PLAYER SETUP
|
// MULTIPLAYER PLAYER SETUP
|
||||||
|
|
|
@ -74,7 +74,7 @@ typedef enum
|
||||||
MN_MP_SERVER,
|
MN_MP_SERVER,
|
||||||
MN_MP_CONNECT,
|
MN_MP_CONNECT,
|
||||||
MN_MP_ROOM,
|
MN_MP_ROOM,
|
||||||
MN_MP_PLAYERSETUP, // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
MN_MP_PLAYERSETUP,
|
||||||
MN_MP_SERVER_OPTIONS,
|
MN_MP_SERVER_OPTIONS,
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
|
|
|
@ -45,9 +45,7 @@ static I_cond MSCond;
|
||||||
# define Unlock_state()
|
# define Unlock_state()
|
||||||
#endif/*HAVE_THREADS*/
|
#endif/*HAVE_THREADS*/
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
static void Command_Listserv_f(void);
|
static void Command_Listserv_f(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif/*MASTERSERVER*/
|
#endif/*MASTERSERVER*/
|
||||||
|
|
||||||
|
@ -89,7 +87,6 @@ msg_rooms_t room_list[NUM_LIST_ROOMS+1]; // +1 for easy test
|
||||||
*/
|
*/
|
||||||
void AddMServCommands(void)
|
void AddMServCommands(void)
|
||||||
{
|
{
|
||||||
#ifndef NONET
|
|
||||||
CV_RegisterVar(&cv_masterserver);
|
CV_RegisterVar(&cv_masterserver);
|
||||||
CV_RegisterVar(&cv_masterserver_update_rate);
|
CV_RegisterVar(&cv_masterserver_update_rate);
|
||||||
CV_RegisterVar(&cv_masterserver_timeout);
|
CV_RegisterVar(&cv_masterserver_timeout);
|
||||||
|
@ -100,7 +97,6 @@ void AddMServCommands(void)
|
||||||
COM_AddCommand("listserv", Command_Listserv_f);
|
COM_AddCommand("listserv", Command_Listserv_f);
|
||||||
COM_AddCommand("masterserver_update", Update_parameters); // allows people to updates manually in case you were delisted by accident
|
COM_AddCommand("masterserver_update", Update_parameters); // allows people to updates manually in case you were delisted by accident
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MASTERSERVER
|
#ifdef MASTERSERVER
|
||||||
|
@ -189,7 +185,6 @@ void GetMODVersion_Console(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NONET
|
|
||||||
/** Gets a list of game servers. Called from console.
|
/** Gets a list of game servers. Called from console.
|
||||||
*/
|
*/
|
||||||
static void Command_Listserv_f(void)
|
static void Command_Listserv_f(void)
|
||||||
|
@ -200,7 +195,6 @@ static void Command_Listserv_f(void)
|
||||||
HMS_list_servers();
|
HMS_list_servers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
Finish_registration (void)
|
Finish_registration (void)
|
||||||
|
|
|
@ -1592,9 +1592,7 @@ void I_Quit(void)
|
||||||
SDLforceUngrabMouse();
|
SDLforceUngrabMouse();
|
||||||
quiting = SDL_FALSE;
|
quiting = SDL_FALSE;
|
||||||
M_SaveConfig(NULL); //save game config, cvars..
|
M_SaveConfig(NULL); //save game config, cvars..
|
||||||
#ifndef NONET
|
|
||||||
D_SaveBan(); // save the ban list
|
D_SaveBan(); // save the ban list
|
||||||
#endif
|
|
||||||
G_SaveGameData(); // Tails 12-08-2002
|
G_SaveGameData(); // Tails 12-08-2002
|
||||||
//added:16-02-98: when recording a demo, should exit using 'q' key,
|
//added:16-02-98: when recording a demo, should exit using 'q' key,
|
||||||
// but sometimes we forget and use 'F10'.. so save here too.
|
// but sometimes we forget and use 'F10'.. so save here too.
|
||||||
|
@ -1709,9 +1707,7 @@ void I_Error(const char *error, ...)
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
M_SaveConfig(NULL); // save game config, cvars..
|
M_SaveConfig(NULL); // save game config, cvars..
|
||||||
#ifndef NONET
|
|
||||||
D_SaveBan(); // save the ban list
|
D_SaveBan(); // save the ban list
|
||||||
#endif
|
|
||||||
G_SaveGameData(); // Tails 12-08-2002
|
G_SaveGameData(); // Tails 12-08-2002
|
||||||
|
|
||||||
// Shutdown. Here might be other errors.
|
// Shutdown. Here might be other errors.
|
||||||
|
|
Loading…
Reference in a new issue