From 89ea943e6a6e47b702be853f659bc6063b601d7b Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 30 Sep 2025 19:32:08 +0200 Subject: [PATCH] delet NONET --- src/Makefile.d/features.mk | 2 - src/Makefile.d/haiku.mk | 2 - src/d_clisrv.c | 61 +++----------------- src/d_clisrv.h | 8 --- src/d_net.c | 51 +---------------- src/d_net.h | 2 - src/d_netcmd.c | 4 -- src/d_netfil.c | 8 +-- src/dedicated/i_system.c | 7 +-- src/doomdef.h | 8 +-- src/g_game.h | 2 - src/hu_stuff.c | 28 ---------- src/i_tcp.c | 112 ++++++------------------------------- src/m_menu.c | 38 +------------ src/m_menudefs.c | 35 +----------- src/mserv.c | 22 +------- src/sdl/i_system.cpp | 8 +-- 17 files changed, 41 insertions(+), 357 deletions(-) diff --git a/src/Makefile.d/features.mk b/src/Makefile.d/features.mk index bb7026924..d6855433f 100644 --- a/src/Makefile.d/features.mk +++ b/src/Makefile.d/features.mk @@ -31,14 +31,12 @@ ifndef NOMD5 sources+=md5.c endif -ifndef NONET ifndef NOSATURNJOIN opts+=-DDOSATURNJOIN endif ifndef NOSATURNPAK opts+=-DDOSATURNPAK endif -endif ifndef NOZLIB ifndef NOPNG diff --git a/src/Makefile.d/haiku.mk b/src/Makefile.d/haiku.mk index 6742ec75b..d702a0623 100644 --- a/src/Makefile.d/haiku.mk +++ b/src/Makefile.d/haiku.mk @@ -19,9 +19,7 @@ else ifeq (${DEDICATED},1) EXENAME?=srb2haikud endif -ifndef NONET libs+=-lnetwork -endif define _set = $(1)_CFLAGS?=$($(1)_opts) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 4723ae415..8f657e342 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2103,7 +2103,6 @@ static void CL_ReloadReceivedSavegame(void) } #endif -#ifndef NONET static void SendAskInfo(INT32 node) { tic_t asktime; @@ -2277,7 +2276,6 @@ void CL_TimeoutServerList(void) } } } -#endif // ifndef NONET static void CL_ConfirmConnect(void) { @@ -2308,7 +2306,6 @@ static void CL_ConfirmConnect(void) static void M_ConfirmConnect(event_t *ev) { -#ifndef NONET if (ev->type == ev_keydown) { if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[0][gc_accelerate][0] || ev->data1 == gamecontrol[0][gc_accelerate][1]) @@ -2323,9 +2320,6 @@ static void M_ConfirmConnect(event_t *ev) M_ClearMenus(true); } } -#else - (void)ev; -#endif } void CL_AbortConnection(void) @@ -2420,29 +2414,25 @@ static boolean CL_FinishedFileList(void) if (!filedownload.http_failed) #endif { -#ifndef NONET filedownload.completednum = 0; filedownload.completedsize = 0; filedownload.totalnum = 0; filedownload.totalsize = 0; -#endif for (i = 0; i < fileneedednum; i++) + { if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD) { -#ifndef NONET filedownload.totalnum++; filedownload.totalsize += fileneeded[i].totalsize; -#endif } + } -#ifndef NONET if (filedownload.totalsize>>20 >= 10) downloadsize = Z_StrDup(va("%uM",filedownload.totalsize>>20)); else downloadsize = Z_StrDup(va("%uK",filedownload.totalsize>>10)); -#endif if (cv_showdownloadprompt.value) { @@ -2496,7 +2486,6 @@ static boolean CL_FinishedFileList(void) */ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent) { -#ifndef NONET INT32 i; // serverlist is updated by GetPacket function @@ -2515,6 +2504,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent) if (i < 0) return true; } + joinnode = i; // Quit here rather than downloading files and being refused later. @@ -2535,6 +2525,7 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent) CONS_Printf("We received a http url from the server, however it will not be used as this build lacks curl support (%s)\n", serverlist[i].info.httpsource); #endif D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded, 0); + if (serverlist[i].info.kartvars & SV_LOTSOFADDONS) { cl_mode = CL_ASKFULLFILELIST; @@ -2559,11 +2550,6 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent) SendAskInfo(servernode); *asksent = I_GetTime() + NEWTICRATE; } -#else - (void)asksent; - // No netgames, so we skip this state. - cl_mode = CL_ASKJOIN; -#endif // ifndef NONET/else return true; } @@ -2583,10 +2569,6 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic boolean waitmore; INT32 i; -#ifdef NONET - (void)tmpsave; -#endif - switch (cl_mode) { case CL_SEARCHING: @@ -2836,9 +2818,7 @@ static void CL_ConnectToServer(void) { INT32 pnumnodes, nodewaited = doomcom->numnodes, i; tic_t oldtic; -#ifndef NONET tic_t asksent; -#endif char tmpsave[264]; sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home); @@ -2873,7 +2853,6 @@ static void CL_ConnectToServer(void) ClearAdminPlayers(); pnumnodes = 1; oldtic = 0; -#ifndef NONET asksent = 0; firstconnectattempttime = I_GetTime(); @@ -2906,16 +2885,11 @@ static void CL_ConnectToServer(void) map_icon_read = 0; map_icon_missing = 0xffffffff; map_icon_last_request = I_GetTime(); -#endif do { // If the connection was aborted for some reason, leave -#ifndef NONET if (!CL_ServerConnectionTicker(tmpsave, &oldtic, &asksent)) -#else - if (!CL_ServerConnectionTicker((char*)NULL, &oldtic, (tic_t *)NULL)) -#endif { if (P_PartialAddGetStage() >= 0) P_MultiSetupWadFiles(true); // in case any partial adds were done @@ -2932,16 +2906,14 @@ static void CL_ConnectToServer(void) } while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes)))); -#ifndef NONET if (netgame) F_StartWaitingPlayers(); -#endif + DEBFILE(va("Synchronisation Finished\n")); displayplayers[0] = consoleplayer; } -#ifndef NONET static void Command_ShowBan(void) //Print out ban list { size_t i; @@ -3327,8 +3299,6 @@ static void Command_Packetstat(void) } } -#endif - static void ResetNode(INT32 node); // @@ -3460,10 +3430,8 @@ void CL_Reset(void) memset(fileneeded, 0, sizeof(fileneeded)); memset(packetstat, 0, sizeof(packetstat)); -#ifndef NONET filedownload.totalnum = 0; filedownload.totalsize = 0; -#endif firstconnectattempttime = 0; serverisfull = false; connectiontimeout = (tic_t)cv_nettimeout.value; //reset this temporary hack @@ -3481,7 +3449,6 @@ void CL_Reset(void) // D_StartTitle should get done now, but the calling function will handle it } -#ifndef NONET static void Command_GetPlayerNum(void) { INT32 i; @@ -3808,7 +3775,6 @@ static void Command_Kick(void) else CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n")); } -#endif static void Got_KickCmd(UINT8 **p, INT32 playernum) { @@ -4236,7 +4202,6 @@ void D_ClientServerInit(void) DEBFILE(va("- - -== SRB2Kart v%d.%d "VERSIONSTRING" debugfile ==- - -\n", VERSION, SUBVERSION)); -#ifndef NONET COM_AddCommand("getplayernum", Command_GetPlayerNum); COM_AddCommand("kick", Command_Kick); COM_AddCommand("ban", Command_Ban); @@ -4262,17 +4227,13 @@ void D_ClientServerInit(void) #ifdef _DEBUG COM_AddCommand("numnodes", Command_Numnodes); #endif -#endif - RegisterNetXCmd(XD_KICK, Got_KickCmd); RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer); RegisterNetXCmd(XD_REMOVEPLAYER, Got_RemovePlayer); -#ifndef NONET #ifdef DUMPCONSISTENCY CV_RegisterVar(&cv_dumpconsistency); #endif D_LoadBan(false); -#endif gametic = 0; localgametic = 0; @@ -4867,18 +4828,17 @@ static void HandleConnect(SINT8 node) } else { -#ifndef NONET boolean newnode = false; -#endif + // client authorised to join nodewaiting[node] = (UINT8)(netbuffer->u.clientcfg.localplayers - playerpernode[node]); if (!nodeingame[node]) { gamestate_t backupstate = gamestate; -#ifndef NONET + newnode = true; -#endif + SV_AddNode(node); /// \note Wait what??? @@ -4949,7 +4909,6 @@ static void HandleTimeout(SINT8 node) M_StartMessage(M_GetText("Server Timeout\n\nPress Esc\n"), NULL, MM_NOTHING); } -#ifndef NONET /** Called when a PT_SERVERINFO packet is received * * \param node The packet sender @@ -5316,8 +5275,6 @@ static void PT_RequestFile(SINT8 node) Net_CloseConnection(node); // nope } -#endif - #ifdef SATURNPAK static void PT_WillResendGamestate(void) { @@ -6046,13 +6003,11 @@ static void GetPackets(void) } } -#ifndef NONET if (netbuffer->packettype == PT_SERVERINFO) { HandleServerInfo(node); continue; } -#endif /*if (netbuffer->packettype == PT_PLAYERINFO) continue; // We do nothing with PLAYERINFO, that's for the MS browser. Not quite true anymore :p*/ diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 6c1bf7bd2..8bfead8d7 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -642,16 +642,9 @@ void D_QuitNetGame(void); //? How many ticks to run? boolean TryRunTics(tic_t realtic); -// extra data for lmps -// these functions scare me. they contain magic. -/*boolean AddLmpExtradata(UINT8 **demo_p, INT32 playernum); -void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum);*/ - -#ifndef NONET // translate a playername in a player number return -1 if not found and // print a error message in the console SINT8 nametonum(const char *name); -#endif extern char motd[254], server_context[8]; extern UINT8 playernode[MAXPLAYERS]; @@ -663,7 +656,6 @@ INT32 D_NumPlayers(void); void D_ResetTiccmds(void); tic_t GetLag(INT32 node); -//UINT8 GetFreeXCmdSize(UINT8 playerid); extern UINT8 hu_resynching; #ifdef SATURNPAK diff --git a/src/d_net.c b/src/d_net.c index b2500e3e5..05df1320c 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -145,7 +145,6 @@ boolean Net_GetNetStat(void) #define URGENTFREESLOTNUM 10 #define ACKTOSENDTIMEOUT (TICRATE/11) -#ifndef NONET typedef struct { UINT8 acknum; @@ -159,7 +158,6 @@ typedef struct doomdata_t data; } pak; } ackpak_t; -#endif typedef enum { @@ -167,10 +165,8 @@ typedef enum NF_TIMEOUT = 2, // Flag is set when the node got a timeout } node_flags_t; -#ifndef NONET // Table of packets that were not acknowleged can be resent (the sender window) static ackpak_t ackpak[MAXACKPACKETS]; -#endif typedef struct { @@ -198,7 +194,6 @@ typedef struct static node_t nodes[MAXNETNODES]; #define NODETIMEOUT 14 -#ifndef NONET // return <0 if a < b (mod 256) // 0 if a = n (mod 256) // >0 if a > b (mod 256) @@ -411,22 +406,16 @@ static boolean Processackpak(void) } return goodpacket; } -#endif // send special packet with only ack on it void Net_SendAcks(INT32 node) { -#ifdef NONET - (void)node; -#else doomdata_t *netbuffer = DOOMCOM_DATA(doomcom); netbuffer->packettype = PT_NOTHING; M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND); HSendPacket(node, false, 0, MAXACKTOSEND); -#endif } -#ifndef NONET static void GotAcks(void) { INT32 i, j; @@ -457,7 +446,6 @@ static void GotAcks(void) } } } -#endif void Net_ConnectionTimeout(INT32 node) { @@ -484,7 +472,6 @@ void Net_ConnectionTimeout(INT32 node) // Resend the data if needed void Net_AckTicker(void) { -#ifndef NONET INT32 i; doomdata_t *netbuffer = DOOMCOM_DATA(doomcom); @@ -534,16 +521,12 @@ void Net_AckTicker(void) } } } -#endif } // Remove last packet received ack before resending the ackreturn // (the higher layer doesn't have room, or something else ....) void Net_UnAcknowledgePacket(INT32 node) { -#ifdef NONET - (void)node; -#else INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND; DEBFILE(va("UnAcknowledge node %d\n", node)); @@ -580,10 +563,8 @@ void Net_UnAcknowledgePacket(INT32 node) if (!nodes[node].firstacktosend) nodes[node].firstacktosend = 1; } -#endif } -#ifndef NONET /** Checks if all acks have been received * * \return True if all acks have been received @@ -601,7 +582,6 @@ static boolean Net_AllAcksReceived(void) return true; } -#endif /** Waits for all ackreturns * @@ -610,9 +590,6 @@ static boolean Net_AllAcksReceived(void) */ void Net_WaitAllAckReceived(UINT32 timeout) { -#ifdef NONET - (void)timeout; -#else tic_t tictac = I_GetTime(); timeout = tictac + timeout*NEWTICRATE; @@ -630,7 +607,6 @@ void Net_WaitAllAckReceived(UINT32 timeout) HGetPacket(); Net_AckTicker(); } -#endif } static void InitNode(node_t *node) @@ -647,10 +623,8 @@ static void InitAck(void) { INT32 i; -#ifndef NONET for (i = 0; i < MAXACKPACKETS; i++) ackpak[i].acknum = 0; -#endif for (i = 0; i < MAXNETNODES; i++) InitNode(&nodes[i]); @@ -663,9 +637,6 @@ static void InitAck(void) */ void Net_AbortPacketType(UINT8 packettype) { -#ifdef NONET - (void)packettype; -#else for (INT32 i = 0; i < MAXACKPACKETS; i++) { if (ackpak[i].acknum && (ackpak[i].pak.data.packettype == packettype @@ -674,7 +645,6 @@ void Net_AbortPacketType(UINT8 packettype) ackpak[i].acknum = 0; } } -#endif } // ----------------------------------------------------------------- @@ -684,9 +654,6 @@ void Net_AbortPacketType(UINT8 packettype) // remove a node, clear all ack from this node and reset askret void Net_CloseConnection(INT32 node) { -#ifdef NONET - (void)node; -#else INT32 i; if (node == -1) @@ -738,10 +705,8 @@ void Net_CloseConnection(INT32 node) InitNode(&nodes[node]); SV_AbortSendFiles(node); I_NetFreeNodenum(node); -#endif } -#ifndef NONET // // Checksum // @@ -757,10 +722,8 @@ static UINT32 NetbufferChecksum(void) return LONG(c); } -#endif #ifdef DEBUGFILE - static void fprintfstring(char *s, size_t len) { INT32 mode = 0; @@ -1032,7 +995,6 @@ void Command_Droprate(void) packetdroprate = droprate; } -#ifndef NONET static boolean ShouldDropPacket(void) { doomdata_t *netbuffer = DOOMCOM_DATA(doomcom); @@ -1040,7 +1002,6 @@ static boolean ShouldDropPacket(void) || (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100; } #endif -#endif // // HSendPacket @@ -1077,11 +1038,6 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen if (!netgame) 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 // the current packet doomcom->remotenode = (INT16)node; @@ -1136,8 +1092,6 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen } #endif -#endif // ndef NONET - return true; } @@ -1171,9 +1125,7 @@ boolean HGetPacket(void) if (!netgame) return false; -#ifndef NONET - - while(true) + while (true) { I_NetGet(); @@ -1216,7 +1168,6 @@ boolean HGetPacket(void) doomcom->datalength -= BASEPACKETSIZE; break; } -#endif // ifndef NONET return true; } diff --git a/src/d_net.h b/src/d_net.h index caeb3c83f..f170cdf05 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -53,10 +53,8 @@ void Net_AckTicker(void); boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength); boolean HGetPacket(void); void D_SetDoomcom(void); -#ifndef NONET void D_SaveBan(void); void D_LoadBan(boolean warning); -#endif boolean D_CheckNetGame(void); void D_CloseConnection(void); void Net_UnAcknowledgePacket(INT32 node); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e77cdbd63..4393600e8 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -721,10 +721,8 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_killingdead); // d_clisrv -#ifndef NONET #ifdef SATURNJOIN CV_RegisterVar(&cv_allownewsaturnplayer); // need to register it before cv_maxplayers && cv_allownewplayer -#endif #endif CV_RegisterVar(&cv_maxplayers); CV_RegisterVar(&cv_resynchattempts); @@ -737,7 +735,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_downloadspeed); CV_RegisterVar(&cv_connectawaittime); CV_RegisterVar(&cv_httpsource); -#ifndef NONET CV_RegisterVar(&cv_allownewplayer); CV_RegisterVar(&cv_joinrefusemessage); @@ -748,7 +745,6 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_showjoinaddress); CV_RegisterVar(&cv_shownodeip); CV_RegisterVar(&cv_blamecfail); -#endif COM_AddCommand("ping", Command_Ping_f); CV_RegisterVar(&cv_nettimeout); diff --git a/src/d_netfil.c b/src/d_netfil.c index 5df28a9b4..a816ca78e 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1006,17 +1006,16 @@ void Got_Filetxpak(void) file->file = NULL; file->status = FS_FOUND; file->justdownloaded = true; - CONS_Printf(M_GetText("Downloading %s...(done)\n"), - filename); -#ifndef NONET + CONS_Printf(M_GetText("Downloading %s...(done)\n"), filename); + filedownload.completednum++; filedownload.completedsize += file->totalsize; -#endif } } else if (!file->justdownloaded) { const char *s; + switch(file->status) { case FS_NOTFOUND: @@ -1035,6 +1034,7 @@ void Got_Filetxpak(void) s = "unknown"; break; } + I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s); } diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index 29e80b843..d0914be56 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -1385,13 +1385,12 @@ void I_Quit(void) static boolean quiting = false; /* prevent recursive I_Quit() */ - if (quiting) goto death; + if (quiting) + goto death; quiting = false; I_ShutdownConsole(); M_SaveConfig(NULL); //save game config, cvars.. -#ifndef NONET D_SaveBan(); // save the ban list -#endif G_SaveGameData(false); // Tails 12-08-2002 //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. @@ -1495,9 +1494,7 @@ void I_Error(const char *error, ...) I_ShutdownConsole(); M_SaveConfig(NULL); // save game config, cvars.. -#ifndef NONET D_SaveBan(); // save the ban list -#endif G_SaveGameData(false); // Tails 12-08-2002 // Shutdown. Here might be other errors. diff --git a/src/doomdef.h b/src/doomdef.h index 52b51076b..620cf164f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -597,7 +597,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; // None of these that are disabled in the normal build are guaranteed to work perfectly // Compile them at your own risk! -#ifndef NONET //-- SATURN __ /// Detect if a client is on Saturn in the clientconfig. /// To seperately allow them to join or block joining from vanilla clients. @@ -612,7 +611,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; #define SATURNPAK #endif //-- <( ̄︶ ̄)> __ -#endif /// Undefine to use the new method of Gamma correction see colour cube in v_video.c #define BACKWARDSCOMPATCORRECTION @@ -634,10 +632,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Most modifications should probably enable this. //#define SAVEGAME_OTHERVERSIONS -#ifndef NONET -/// Display a connection screen on join attempts. +/// Display a connection screen on join attempts. #define CLIENT_LOADINGSCREEN -#endif /// Backwards compatibility with musicslots. /// \note You should leave this enabled unless you're working with a future SRB2 version. @@ -659,7 +655,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; #define ROTANGLES 180 // Needs to be a divisor of 360 (45, 60, 90, 120...) #define ROTANGDIFF (360 / ROTANGLES) -#if defined (HAVE_CURL) && ! defined (NONET) +#if defined (HAVE_CURL) #define MASTERSERVER //#define HOLEPUNCH #else diff --git a/src/g_game.h b/src/g_game.h index 43d9d14b2..4812a2c1f 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -129,9 +129,7 @@ extern consvar_t cv_playerblendeffects; extern consvar_t cv_cechotoggle; -#ifndef NONET extern consvar_t cv_chatlogsize; -#endif typedef enum { diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ec7f486ab..382628d90 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -275,14 +275,12 @@ static INT32 cechoflags = 0; static tic_t resynch_ticker = 0; -#ifndef NONET // just after static void Command_Say_f(void); static void Command_Sayto_f(void); static void Command_Sayteam_f(void); static void Command_CSay_f(void); static void Got_Saycmd(UINT8 **p, INT32 playernum); -#endif void HU_LoadGraphics(void) { @@ -399,13 +397,11 @@ void HU_LoadGraphics(void) // void HU_Init(void) { -#ifndef NONET COM_AddCommand("say", Command_Say_f); COM_AddCommand("sayto", Command_Sayto_f); COM_AddCommand("sayteam", Command_Sayteam_f); COM_AddCommand("csay", Command_CSay_f); RegisterNetXCmd(XD_SAY, Got_Saycmd); -#endif // set shift translation table shiftxform = english_shiftxform; @@ -442,8 +438,6 @@ void HU_Shiftform(void) // EXECUTION //====================================================================== -#ifndef NONET - // EVERY CHANGE IN THIS SCRIPT IS LOL XD! BY VINCYTM static void Chatlogsize_OnChange(void); @@ -522,11 +516,9 @@ static void Chatlogsize_OnChange(void) #undef reallocarray chat_nummsg_log = min(chat_nummsg_log, (UINT32)cv_chatlogsize.value); } -#endif 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. 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. @@ -559,14 +551,8 @@ void HU_AddChatText(const char *text, boolean playsound) CON_LogMessage(text); CON_LogMessage("\n"); // Add newline. Don't use va for that, since `text` might be refering to va's buffer itself } -#else - (void)playsound; - CONS_Printf("%s\n", text); -#endif } -#ifndef NONET - /** Runs a say command, sending an ::XD_SAY message. * A say command consists of a signed 8-bit integer for the target, an * unsigned 8-bit flag variable, and then the message itself. @@ -1087,8 +1073,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) #endif } -#endif - // // void HU_Ticker(void) @@ -1146,8 +1130,6 @@ void HU_Ticker(void) HU_TickSongCredits(); } -#ifndef NONET - static boolean teamtalk = false; /*static char chatchars[QUEUESIZE]; static INT32 head = 0, tail = 0;*/ @@ -1299,7 +1281,6 @@ static void HU_SendChatMessage(void) SendNetXCmd(XD_SAY, buf, 2 + strlen(&buf[2]) + 1); } } -#endif void HU_clearChatChars(void) { @@ -1308,12 +1289,10 @@ void HU_clearChatChars(void) I_SetTextInput(false); } -#ifndef NONET static boolean justscrolleddown; static boolean justscrolledup; static INT16 typelines = 1; // number of drawfill lines we need when drawing the chat. it's some weird hack and might be one frame off but I'm lazy to make another loop. // It's up here since it has to be reset when we open the chat. -#endif // // Returns true if key eaten @@ -1345,7 +1324,6 @@ boolean HU_Responder(event_t *ev) return false; } -#ifndef NONET if (!chat_on) { // enter chat mode @@ -1423,7 +1401,6 @@ boolean HU_Responder(event_t *ev) } return true; } -#endif return false; } @@ -1432,8 +1409,6 @@ boolean HU_Responder(event_t *ev) // HEADS UP DRAWING //====================================================================== -#ifndef NONET - #define HU_DrawEmote(x, y, emote, flags) M_DrawEmote((x), (y), (emote), hu_emoteanim, (flags)) // Precompile a wordwrapped string to any given width. @@ -2114,7 +2089,6 @@ static void HU_DrawChat_Old(void) } } } -#endif static void HU_DrawCEcho(void) { @@ -2343,7 +2317,6 @@ void HU_Drawer(void) if (cv_vhseffect.value && ((paused && !camera[R_GetViewNumber()].freecam) || (demo.playback && cv_playbackspeed.value > 1))) V_DrawVhsEffect(demo.rewinding); -#ifndef NONET // draw chat string plus cursor if (chat_on) { @@ -2360,7 +2333,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) HU_drawMiniChat(); // draw messages in a cool fashion. } -#endif if (cechotimer) HU_DrawCEcho(); diff --git a/src/i_tcp.c b/src/i_tcp.c index 299a4b5c1..f6152e3cd 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -42,13 +42,6 @@ #include "doomdef.h" -#if defined (NOMD5) && !defined (NONET) -//#define NONET -#endif - -#ifdef NONET -#undef HAVE_MINIUPNPC -#else #include #ifdef USE_WINSOCK1 #include @@ -71,7 +64,7 @@ #if defined (__unix__) || defined (__APPLE__) || defined (UNIXCOMMON) #include #endif // UNIXCOMMON -#endif // !NONET +#endif #ifdef USE_WINSOCK // some undefined under win32 @@ -139,8 +132,6 @@ typedef union static UINT8 UPNP_support = TRUE; #endif -#endif // !NONET - #include "i_system.h" #include "i_time.h" #include "i_net.h" @@ -164,7 +155,7 @@ static UINT8 UPNP_support = TRUE; #include "i_addrinfo.h" #define DEFAULTPORT "5029" -#if defined (USE_WINSOCK) && !defined (NONET) +#if defined (USE_WINSOCK) typedef SOCKET SOCKET_TYPE; #define ERRSOCKET (SOCKET_ERROR) #else @@ -182,8 +173,6 @@ typedef unsigned long SOCKET_TYPE; typedef int socklen_t; #endif -#ifndef NONET - typedef struct { mysockaddr_t address; @@ -206,7 +195,6 @@ static banned_t *banned; #ifdef HOLEPUNCH static const INT32 hole_punch_magic = MSBF_LONG (0x52eb11); #endif -#endif static size_t numbans = 0; static size_t banned_size = 0; @@ -217,8 +205,6 @@ static boolean init_tcp_driver = false; static const char *serverport_name = DEFAULTPORT; static const char *clientport_name;/* any port */ -#ifndef NONET - #ifdef USE_WINSOCK // stupid microsoft makes things complicated static char *get_WSAErrorStr(int e) @@ -423,83 +409,62 @@ static const char *SOCK_AddrToStr(mysockaddr_t *sk) #endif return s; } -#endif static const char *SOCK_GetNodeAddress(INT32 node) { if (node == 0) return "self"; -#ifdef NONET - return NULL; -#else + if (!nodeconnected[node]) return NULL; + return SOCK_AddrToStr(&clientaddress[node]); -#endif } static const char *SOCK_GetBanAddress(size_t ban) { if (ban >= numbans) return NULL; -#ifdef NONET - return NULL; -#else + return SOCK_AddrToStr(&banned[ban].address); -#endif } 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 + if (ban >= numbans) return NULL; + if (sprintf(s,"%d",banned[ban].mask) > 0) return s; -#endif + return NULL; } static const char *SOCK_GetBanUsername(size_t ban) { -#ifdef NONET - (void)ban; - return NULL; -#else if (ban >= numbans) return NULL; + return banned[ban].username; -#endif } static const char *SOCK_GetBanReason(size_t ban) { -#ifdef NONET - (void)ban; - return NULL; -#else if (ban >= numbans) return NULL; + return banned[ban].reason; -#endif } static time_t SOCK_GetUnbanTime(size_t ban) { -#ifdef NONET - (void)ban; - return NO_BAN_TIME; -#else if (ban >= numbans) return NO_BAN_TIME; - return banned[ban].timestamp; -#endif -} -#ifndef NONET + return banned[ban].timestamp; +} #ifdef HAVE_IPV6 static boolean SOCK_cmpipv6(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask) @@ -624,9 +589,7 @@ void Command_Numnodes(void) connected, ingame); } #endif -#endif -#ifndef NONET #ifdef HOLEPUNCH /* not one of the reserved "local" addresses */ static boolean @@ -783,9 +746,7 @@ static boolean SOCK_Get(void) doomcom->remotenode = -1; // no packet return false; } -#endif -#ifndef NONET static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr) { socklen_t d4 = (socklen_t)sizeof(struct sockaddr_in); @@ -869,9 +830,7 @@ static void SOCK_Send(void) } } #undef ALLOWEDERROR -#endif //NONET -#ifndef NONET static void SOCK_FreeNodenum(INT32 numnode) { // can't disconnect from self :) @@ -886,13 +845,10 @@ static void SOCK_FreeNodenum(INT32 numnode) // put invalid address memset(&clientaddress[numnode], 0, sizeof (clientaddress[numnode])); } -#endif // // UDPsocket // -#ifndef NONET - // allocate a socket static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen) { @@ -1252,12 +1208,11 @@ static boolean UDP_Socket(void) return true; } -#endif boolean I_InitTcpDriver(void) { boolean tcp_was_up = init_tcp_driver; -#ifndef NONET + if (!init_tcp_driver) { #ifdef USE_WINSOCK @@ -1312,7 +1267,7 @@ boolean I_InitTcpDriver(void) #endif init_tcp_driver = true; } -#endif + if (!tcp_was_up && init_tcp_driver) { I_AddExitFunc(I_ShutdownTcpDriver); @@ -1326,7 +1281,6 @@ boolean I_InitTcpDriver(void) return init_tcp_driver; } -#ifndef NONET static void SOCK_CloseSocket(void) { size_t i; @@ -1340,11 +1294,9 @@ static void SOCK_CloseSocket(void) mysocketses = 0; } -#endif void I_ShutdownTcpDriver(void) { -#ifndef NONET SOCK_CloseSocket(); CONS_Printf("I_ShutdownTcpDriver: "); @@ -1354,10 +1306,8 @@ void I_ShutdownTcpDriver(void) #endif CONS_Printf("shut down\n"); init_tcp_driver = false; -#endif } -#ifndef NONET static boolean SOCK_GetAddr(struct sockaddr_in *sin, const char *address, const char *port, boolean test) { struct my_addrinfo *ai = NULL, *runp, hints; @@ -1486,11 +1436,9 @@ static void SOCK_RegisterHolePunch(void) rendezvous(4); } #endif -#endif static boolean SOCK_OpenSocket(void) { -#ifndef NONET size_t i; memset(clientaddress, 0, sizeof (clientaddress)); @@ -1513,9 +1461,6 @@ static boolean SOCK_OpenSocket(void) // build the socket but close it first SOCK_CloseSocket(); return UDP_Socket(); -#else - return false; -#endif } static void AddBannedIndex(void) @@ -1544,11 +1489,6 @@ static boolean SOCK_Ban(INT32 node) if (node > MAXNETNODES) return false; -#ifdef NONET - (void)ban; - return false; -#else - ban = numbans; AddBannedIndex(); @@ -1568,15 +1508,10 @@ static boolean SOCK_Ban(INT32 node) #endif return true; -#endif } static boolean SOCK_SetBanUsername(const char *username) { -#ifdef NONET - (void)username; - return false; -#else if (username == NULL || strlen(username) == 0) { username = "Direct IP ban"; @@ -1589,16 +1524,12 @@ static boolean SOCK_SetBanUsername(const char *username) } banned[numbans - 1].username = Z_StrDup(username); + return true; -#endif } static boolean SOCK_SetBanReason(const char *reason) { -#ifdef NONET - (void)reason; - return false; -#else if (reason == NULL || strlen(reason) == 0) { reason = "No reason given"; @@ -1611,28 +1542,18 @@ static boolean SOCK_SetBanReason(const char *reason) } banned[numbans - 1].reason = Z_StrDup(reason); + return true; -#endif } static boolean SOCK_SetUnbanTime(time_t timestamp) { -#ifdef NONET - (void)reason; - return false; -#else banned[numbans - 1].timestamp = timestamp; return true; -#endif } 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; int gaie; @@ -1693,7 +1614,6 @@ static boolean SOCK_SetBanAddress(const char *address, const char *mask) I_freeaddrinfo(ai); return true; -#endif } static void SOCK_ClearBans(void) diff --git a/src/m_menu.c b/src/m_menu.c index 54c57aaa9..0248ffc85 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -174,13 +174,12 @@ levellist_mode_t levellistmode = LLM_CREATESERVER; UINT8 maplistoption = 0; static char joystickInfo[8][29]; -#ifndef NONET + static UINT32 serverlistpage; static UINT32 oldserverlistpage; static float serverlistslidex; static INT32 serverlistsearched[MAXSERVERLIST] = {0}; static UINT32 serverlistsearchedcount = 0; -#endif //static saveinfo_t savegameinfo[MAXSAVEGAMES]; // Extra info about the save games. @@ -206,11 +205,9 @@ static INT32 vidm_column_size; static void M_StopMessage(INT32 choice); -#ifndef NONET static void M_HandleServerPage(INT32 choice); static void M_HandleServerSearch(INT32 choice); static void M_SearchServerList(void); -#endif // Prototyping is fun, innit? // ========================================================================== @@ -262,7 +259,6 @@ static void M_ModeAttackEndGame(INT32 choice); static void M_SetGuestReplay(INT32 choice); // Multiplayer -#ifndef NONET static void M_PreStartServerMenu(INT32 choice); #ifdef MASTERSERVER static void M_PreStartServerMenuChoice(event_t *ev); @@ -276,7 +272,6 @@ static void M_ConnectMenuModChecks(INT32 choice); #endif static void M_Refresh(INT32 choice); static void M_Connect(INT32 choice); -#endif static void M_StartOfflineServerMenu(INT32 choice); static void M_StartServer(INT32 choice); static void M_SetupMultiPlayer(void); @@ -359,28 +354,21 @@ static void M_DrawVideoMode(void); static void M_DrawColorMenu(void); static void M_DrawMonitorToggles(void); static void M_DrawMPMainMenu(void); -#ifndef NONET static void M_DrawConnectMenu(void); -#endif static void M_DrawJoystick(void); static void M_DrawSetupMultiPlayerMenu(void); static void M_DrawLocalSkinMenu(void); // Handling functions -#ifndef NONET static boolean M_CancelConnect(void); -#endif static boolean M_QuitMultiPlayerMenu(void); static void M_HandleAddons(INT32 choice); static void M_HandleSoundTest(INT32 choice); static void M_HandleMusicTest(INT32 choice); static void M_HandleImageDef(INT32 choice); -//static void M_HandleLoadSave(INT32 choice); static void M_HandleLevelStats(INT32 choice); -#ifndef NONET static void M_HandleConnectIP(INT32 choice); static void M_ConnectLastServer(INT32 choice); -#endif static void M_HandleSetupMultiPlayer(INT32 choice); static void M_HandleVideoMode(INT32 choice); static void M_ResetCvars(void); @@ -642,12 +630,11 @@ static void M_ChangeCvar(INT32 choice) } else { -#ifndef NONET if (cv == &cv_nettimeout || cv == &cv_jointimeout) choice *= (TICRATE/7); else if (cv == &cv_maxsend) choice *= 512; -#endif + CV_AddValue(cv,choice); } } @@ -1884,9 +1871,7 @@ void M_Init(void) if (!minidoticon && !minilighticon) OP_SaturnHudMenu[sh_minidot].status = IT_GRAYEDOUT; -#ifndef NONET CV_RegisterVar(&cv_serversort); -#endif //todo put this somewhere better... CV_RegisterVar(&cv_allcaps); @@ -6504,7 +6489,6 @@ static void Fetch_servers_thread(int *id) #define S_LINEY(n) currentMenu->y + SERVERHEADERHEIGHT + (n * SERVERLINEHEIGHT) -#ifndef NONET static UINT32 localservercount; static void M_SearchServerList(void) @@ -6840,11 +6824,9 @@ static int ServerListEntryComparator_modified(const void *entry1, const void *en // Default to strcmp. return strcmp(sa->info.servername, sb->info.servername); } -#endif void M_SortServerList(void) { -#ifndef NONET switch(cv_serversort.value) { case 0: // Ping. @@ -6866,11 +6848,10 @@ void M_SortServerList(void) qs22j(serverlist, serverlistcount, sizeof(serverelem_t), ServerListEntryComparator_gametype); break; } + M_SearchServerList(); -#endif } -#ifndef NONET #ifdef UPDATE_ALERT #ifdef MASTERSERVER static void M_CheckMODVersion(int id) @@ -7054,7 +7035,6 @@ static void M_PreConnectMenuChoice(event_t *ev) M_ConnectMenuModChecks(-1); } #endif -#endif //NONET //=========================================================================== // Start Server Menu @@ -7341,7 +7321,6 @@ static void M_StartOfflineServerMenu(INT32 choice) M_SetupNextMenu(&MP_OfflineServerDef); } -#ifndef NONET static void M_StartServerMenu(INT32 choice) { (void)choice; @@ -7361,15 +7340,12 @@ static void M_StartServerMenu(INT32 choice) #define SETUPM_IP_MAXSIZE ((28-1)*8) static char setupm_ip[64]; static textinput_t setupm_input_ip; -#endif void M_Multiplayer(INT32 choice) { (void)choice; -#ifndef NONET memset(setupm_ip, 0, sizeof(setupm_ip)); M_TextInputInit(&setupm_input_ip, setupm_ip, sizeof(setupm_ip)); -#endif M_SetupNextMenu(&MP_MainDef); } @@ -7385,20 +7361,17 @@ static void M_DrawMPMainMenu(void) // use generic drawer for cursor, items and title M_DrawGenericMenu(); -#ifndef NONET #if MAXPLAYERS != 16 Update the maxplayers label... #endif V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[4].alphaKey, ((itemOn == 4) ? highlightflags : 0)|MENUCAPS, "(2-16 Players)"); -#endif V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[5].alphaKey, ((itemOn == 5) ? highlightflags : 0)|MENUCAPS, "(2-4 players)" ); -#ifndef NONET y += MP_MainMenu[9].alphaKey; V_DrawFill(x+5, y+4+5, /*16*8 + 6,*/ BASEVIDWIDTH - 2*(x+5), 8+6, 239); @@ -7408,7 +7381,6 @@ Update the maxplayers label... V_DrawString(x+8,y+12, V_ALLOWLOWERCASE, setupm_ip); else M_DrawTextInputScroll(x+8, y+12, &setupm_input_ip, 0, SETUPM_IP_MAXSIZE); -#endif // character bar, ripped off the color bar :V { @@ -7550,8 +7522,6 @@ static void M_SetupMultiHandler(INT32 choice) } } -#ifndef NONET - // Tails 11-19-2002 static void M_ConnectIP(INT32 choice) { @@ -7576,7 +7546,6 @@ static void M_ConnectIP(INT32 choice) I_FinishUpdate(); // page flip or blit buffer } - //Join Last server static void M_ConnectLastServer(INT32 choice) { @@ -7647,7 +7616,6 @@ static void M_HandleConnectIP(INT32 choice) M_ClearMenus(true); } } -#endif //!NONET // ======================== // MULTIPLAYER PLAYER SETUP diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 7e0dd10d8..34e81193f 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -62,9 +62,7 @@ menu_t OP_DiscordOptionsDef; #endif menu_t OP_HUDOptionsDef, OP_ChatOptionsDef; menu_t OP_GameOptionsDef, OP_ServerOptionsDef; -#ifndef NONET menu_t OP_AdvServerOptionsDef; -#endif menu_t OP_MonitorToggleDef; menu_t OP_AccessibilityDef; @@ -516,15 +514,10 @@ static menuitem_t MP_MainMenu[] = {IT_STRING|IT_KEYHANDLER,NULL, "Player setup...", M_SetupMultiHandler, 18}, {IT_HEADER, NULL, "Host a game", NULL, 100-24}, -#ifndef NONET {IT_STRING|IT_CALL, NULL, "Internet/LAN...", M_PreStartServerMenu, 110-24}, -#else - {IT_GRAYEDOUT, NULL, "Internet/LAN...", NULL, 110-24}, -#endif {IT_STRING|IT_CALL, NULL, "Offline...", M_StartOfflineServerMenu, 118-24}, {IT_HEADER, NULL, "Join a game", NULL, 132-24}, -#ifndef NONET #ifndef MASTERSERVER {IT_GRAYEDOUT, NULL, "Internet server browser...",NULL, 142-24}, #else @@ -532,14 +525,8 @@ static menuitem_t MP_MainMenu[] = #endif {IT_STRING|IT_CALL, NULL, "Join last server", M_ConnectLastServer, 150-24}, {IT_STRING|IT_KEYHANDLER, NULL, "Specify IPv4 address:", M_HandleConnectIP, 158-24}, -#else - {IT_GRAYEDOUT, NULL, "Internet server browser...",NULL, 142-24}, - {IT_GRAYEDOUT, NULL, "Join last server", NULL, 150-24}, - {IT_GRAYEDOUT, NULL, "Specify IPv4 address:", NULL, 158-24}, -#endif }; -#ifndef NONET static menuitem_t MP_ServerMenu[] = { {IT_STRING|IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 10}, @@ -555,7 +542,6 @@ static menuitem_t MP_ServerMenu[] = {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, }; -#endif // Separated offline and normal servers. static menuitem_t MP_OfflineServerMenu[] = @@ -573,7 +559,6 @@ static menuitem_t MP_PlayerSetupMenu[] = {IT_KEYHANDLER | IT_STRING, NULL, "Color", M_HandleSetupMultiPlayer, 152}, }; -#ifndef NONET static menuitem_t MP_ConnectMenu[] = { {IT_STRING | IT_CVAR, NULL, "Sort By", &cv_serversort, 0}, @@ -601,7 +586,6 @@ enum mp_connect_search, FIRSTSERVERLINE }; -#endif // ------------------------------------ // Options and most (?) of its submenus @@ -1473,16 +1457,13 @@ static const char* OP_GameTooltips[] = static menuitem_t OP_ServerOptionsMenu[] = { -#ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Server Name", &cv_servername, 10}, -#endif {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40}, {IT_STRING | IT_CVAR, NULL, "Map Progression", &cv_advancemap, 50}, {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60}, {IT_STRING | IT_CVAR, NULL, "Voting Rule Changes", &cv_kartvoterulechanges, 70}, -#ifndef NONET {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, {IT_STRING | IT_CVAR, NULL, "Allow Addon Downloading", &cv_downloading, 110}, @@ -1490,29 +1471,23 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Mute All Chat", &cv_mute, 130}, {IT_SUBMENU|IT_STRING, NULL, "Advanced Options...", &OP_AdvServerOptionsDef,150}, -#endif }; static const char* OP_ServerOptionsTooltips[] = { -#ifndef NONET "Name of server.", -#endif "Length of intermission after races.", "How the next map to be played is choosen.", "How long map voting is.", "How often should other gamemodes appear.", -#ifndef NONET "Max amount of players allowed in this server.", "Allow players to join this server.", "Allow players to download addons.", "Who has permission to pause the server?", "Completely mute in game chat.", "Options for advanced server settings.", -#endif }; -#ifndef NONET static menuitem_t OP_AdvServerOptionsMenu[] = { #ifndef MASTERSERVER @@ -1570,7 +1545,6 @@ static const char* OP_AdvServerOptionsTooltips[] = "Log player resync attempts.", "Log player file transfers.", }; -#endif #define ITEMTOGGLEBOTTOMRIGHT @@ -2398,17 +2372,12 @@ menu_t MP_MainDef = M_DrawMPMainMenu, 42, 30, 0, -#ifndef NONET M_CancelConnect, -#else - NULL, -#endif NULL }; menu_t MP_OfflineServerDef = MAPICONMENUSTYLE("M_MULTI", MP_OfflineServerMenu, &MP_MainDef); -#ifndef NONET menu_t MP_ServerDef = MAPICONMENUSTYLE("M_MULTI", MP_ServerMenu, &MP_MainDef); menu_t MP_ConnectDef = @@ -2423,7 +2392,7 @@ menu_t MP_ConnectDef = M_CancelConnect, NULL }; -#endif + menu_t MP_PlayerSetupDef = { NULL, //"M_SPLAYR" @@ -2553,9 +2522,7 @@ menu_t OP_FocusOptionsDef = DEFAULTMENUSTYLE(NULL, OP_FocusOptionsMenu, &OP_Main menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 20, OP_GameTooltips); menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 24, 20, OP_ServerOptionsTooltips); -#ifndef NONET menu_t OP_AdvServerOptionsDef = DEFAULTSCROLLSTYLE("M_SERVER", OP_AdvServerOptionsMenu, &OP_ServerOptionsDef, 24, 30, OP_AdvServerOptionsTooltips); -#endif menu_t OP_MonitorToggleDef = { diff --git a/src/mserv.c b/src/mserv.c index 2f172d27d..c7eb50442 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -29,7 +29,6 @@ #endif #ifdef MASTERSERVER - static int MSId; static int MSRegisteredId = -1; @@ -52,18 +51,12 @@ static I_cond MSCond; # define Unlock_state() #endif/*HAVE_THREADS*/ -#ifndef NONET static void Command_Listserv_f(void); -#endif - #endif/*MASTERSERVER*/ - - -static void Update_parameters (void); +static void Update_parameters(void); #ifdef MASTERSERVER - static void MasterServer_OnChange(void); static void Advertise_OnChange(void); @@ -112,7 +105,6 @@ UINT16 current_port = 0; */ void AddMServCommands(void) { -#ifndef NONET #ifdef MASTERSERVER CV_RegisterVar(&cv_masterserver); CV_RegisterVar(&cv_masterserver_update_rate); @@ -125,13 +117,11 @@ void AddMServCommands(void) #ifdef HOLEPUNCH CV_RegisterVar(&cv_rendezvousserver); #endif - CV_RegisterVar(&cv_servername); CV_RegisterVar(&cv_server_contact); #ifdef MASTERSERVER COM_AddCommand("listserv", Command_Listserv_f); #endif -#endif } #ifdef MASTERSERVER @@ -200,23 +190,17 @@ char *GetMODVersion(int id) } #endif -#ifndef NONET /** Gets a list of game servers. Called from console. */ static void Command_Listserv_f(void) { CONS_Printf(M_GetText("Retrieving server list...\n")); - - { - HMS_list_servers(); - } + HMS_list_servers(); } -#endif static boolean firstmsrules = false; -static void -Get_masterserver_rules (boolean checkfirst) +static void Get_masterserver_rules(boolean checkfirst) { char rules[256]; diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 491099fb3..4415727e5 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1936,9 +1936,7 @@ void I_Quit(void) quiting = SDL_FALSE; I_ShutdownConsole(); M_SaveConfig(NULL); //save game config, cvars.. -#ifndef NONET D_SaveBan(); // save the ban list -#endif G_SaveGameData(false); // Tails 12-08-2002 //added:16-02-98: when recording a demo, should exit using 'q' key, // but sometimes we forget and use 'F10'.. so save here too. @@ -2061,9 +2059,7 @@ void I_Error(const char *error, ...) I_ShutdownConsole(); M_SaveConfig(NULL); // save game config, cvars.. -#ifndef NONET D_SaveBan(); // save the ban list -#endif G_SaveGameData(false); // Tails 12-08-2002 // Shutdown. Here might be other errors. @@ -2082,9 +2078,7 @@ void I_Error(const char *error, ...) // Implement message box with SDL_ShowSimpleMessageBox, // which should fail gracefully if it can't put a message box up // on the target system - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, - "SRB2Kart " VERSIONSTRING " Error", - buffer, NULL); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "SRB2Kart " VERSIONSTRING " Error", buffer, NULL); // Note that SDL_ShowSimpleMessageBox does *not* require SDL to be // initialized at the time, so calling it after SDL_Quit() is // perfectly okay! In addition, we do this on purpose so the