From 746072c58bb74ab7cc20ac7ffc6f6f3ff002888d Mon Sep 17 00:00:00 2001 From: Hanicef Date: Thu, 27 Jun 2024 20:59:14 +0200 Subject: [PATCH] Remove unused low-level netcode stuff --- src/netcode/d_net.c | 27 +-------------------------- src/netcode/d_netfil.c | 1 - src/netcode/i_net.h | 20 -------------------- src/netcode/i_tcp.c | 2 -- 4 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/netcode/d_net.c b/src/netcode/d_net.c index b24409db1..4f21ca984 100644 --- a/src/netcode/d_net.c +++ b/src/netcode/d_net.c @@ -62,9 +62,6 @@ static doomdata_t reboundstore[MAXREBOUND]; static INT16 reboundsize[MAXREBOUND]; static INT32 rebound_head, rebound_tail; -/// \brief bandwith of netgame -INT32 net_bandwidth; - /// \brief max length per packet INT16 hardware_MAXPACKETLENGTH; @@ -1189,10 +1186,7 @@ void D_SetDoomcom(void) { if (doomcom) return; doomcom = Z_Calloc(sizeof (doomcom_t), PU_STATIC, NULL); - doomcom->id = DOOMCOM_ID; doomcom->numslots = doomcom->numnodes = 1; - doomcom->gametype = 0; - doomcom->consoleplayer = 0; doomcom->extratics = 0; } @@ -1217,7 +1211,6 @@ boolean D_CheckNetGame(void) I_NetMakeNodewPort = NULL; hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; - net_bandwidth = 30000; // I_InitNetwork sets doomcom and netgame // check and initialize the network driver multiplayer = false; @@ -1237,7 +1230,6 @@ boolean D_CheckNetGame(void) server = true; // WTF? server always true??? // no! The deault mode is server. Client is set elsewhere // when the client executes connect command. - doomcom->ticdup = 1; if (M_CheckParm("-extratic")) { @@ -1248,21 +1240,6 @@ boolean D_CheckNetGame(void) CONS_Printf(M_GetText("Set extratics to %d\n"), doomcom->extratics); } - if (M_CheckParm("-bandwidth")) - { - if (M_IsNextParm()) - { - net_bandwidth = atoi(M_GetNextParm()); - if (net_bandwidth < 1000) - net_bandwidth = 1000; - if (net_bandwidth > 100000) - hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; - CONS_Printf(M_GetText("Network bandwidth set to %d\n"), net_bandwidth); - } - else - I_Error("usage: -bandwidth "); - } - software_MAXPACKETLENGTH = hardware_MAXPACKETLENGTH; if (M_CheckParm("-packetsize")) { @@ -1282,8 +1259,6 @@ boolean D_CheckNetGame(void) if (netgame) multiplayer = true; - if (doomcom->id != DOOMCOM_ID) - I_Error("Doomcom buffer invalid!"); if (doomcom->numnodes > MAXNETNODES) I_Error("Too many nodes (%d), max:%d", doomcom->numnodes, MAXNETNODES); @@ -1293,7 +1268,7 @@ boolean D_CheckNetGame(void) if (M_CheckParm("-debugfile")) { char filename[21]; - INT32 k = doomcom->consoleplayer - 1; + INT32 k = consoleplayer - 1; if (M_IsNextParm()) k = atoi(M_GetNextParm()) - 1; while (!debugfile && k < MAXPLAYERS) diff --git a/src/netcode/d_netfil.c b/src/netcode/d_netfil.c index a8a10d475..adec1a0e4 100644 --- a/src/netcode/d_netfil.c +++ b/src/netcode/d_netfil.c @@ -1033,7 +1033,6 @@ void FileSendTicker(void) netbuffer->packettype = PT_FILEFRAGMENT; - // (((sendbytes-nowsentbyte)*TICRATE)/(I_GetTime()-starttime)<(UINT32)net_bandwidth) while (packetsent-- && filestosend != 0) { for (i = currentnode, j = 0; j < MAXNETNODES; diff --git a/src/netcode/i_net.h b/src/netcode/i_net.h index 09b842296..6ac4bfc87 100644 --- a/src/netcode/i_net.h +++ b/src/netcode/i_net.h @@ -32,7 +32,6 @@ #define INETPACKETLENGTH 1024 extern INT16 hardware_MAXPACKETLENGTH; -extern INT32 net_bandwidth; // in byte/s #if defined(_MSC_VER) #pragma pack(1) @@ -40,36 +39,17 @@ extern INT32 net_bandwidth; // in byte/s typedef struct { - /// Supposed to be DOOMCOM_ID - INT32 id; - - /// SRB2 executes an INT32 to execute commands. - INT16 intnum; - /// Communication between SRB2 and the driver. - /// Is CMD_SEND or CMD_GET. - INT16 command; /// Is dest for send, set by get (-1 = no packet). INT16 remotenode; - /// Number of bytes in doomdata to be sent INT16 datalength; /// Info common to all nodes. /// Console is always node 0. INT16 numnodes; - /// Flag: 1 = no duplication, 2-5 = dup for slow nets. - INT16 ticdup; /// Flag: 1 = send a backup tic in every packet. INT16 extratics; - /// kind of game - INT16 gametype; - /// Flag: -1 = new game, 0-5 = load savegame - INT16 savegame; - /// currect map - INT16 map; - /// Info specific to this node. - INT16 consoleplayer; /// Number of "slots": the highest player number in use plus one. INT16 numslots; diff --git a/src/netcode/i_tcp.c b/src/netcode/i_tcp.c index 6a50f440b..1eb63b6bf 100644 --- a/src/netcode/i_tcp.c +++ b/src/netcode/i_tcp.c @@ -1374,7 +1374,6 @@ boolean I_InitTcpNetwork(void) // FIXME: // ??? and now ? // server on a big modem ??? 4*isdn - net_bandwidth = 16000; hardware_MAXPACKETLENGTH = INETPACKETLENGTH; ret = true; @@ -1403,7 +1402,6 @@ boolean I_InitTcpNetwork(void) // so we're on a LAN COM_BufAddText("connect any\n"); - net_bandwidth = 800000; hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; } }