From f4330d765d32d248fc8349a9e782c099b0f3bb5c Mon Sep 17 00:00:00 2001 From: Shpoike Date: Fri, 25 Aug 2023 22:39:32 +0100 Subject: [PATCH] Clean up some buffers that were never used. --- engine/server/server.h | 6 ------ engine/server/sv_ccmds.c | 2 +- engine/server/sv_init.c | 9 --------- engine/server/sv_send.c | 28 +++------------------------- 4 files changed, 4 insertions(+), 41 deletions(-) diff --git a/engine/server/server.h b/engine/server/server.h index ccfae5741..87b1b0ed1 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -207,12 +207,6 @@ typedef struct server_s #endif #ifdef Q2SERVER - sizebuf_t q2datagram; - qbyte q2datagram_buf[MAX_Q2DATAGRAM]; - - sizebuf_t q2reliable_datagram; - qbyte q2reliable_datagram_buf[MAX_Q2MSGLEN]; - sizebuf_t q2multicast; qbyte q2multicast_buf[MAX_Q2MSGLEN]; #endif diff --git a/engine/server/sv_ccmds.c b/engine/server/sv_ccmds.c index 36f99d124..1f895c848 100644 --- a/engine/server/sv_ccmds.c +++ b/engine/server/sv_ccmds.c @@ -2126,7 +2126,7 @@ static void SV_StuffToClient_f(void) while((cl = SV_GetClientForString(clientname, &clnum))) { - if (cl->protocol == SCP_QUAKE2) + if (ISQ2CLIENT(cl)) ClientReliableWrite_Begin (cl, svcq2_stufftext, 3+strlen(str) + (key?strlen(key)+6:0)); else ClientReliableWrite_Begin (cl, svc_stufftext, 3+strlen(str) + (key?strlen(key)+6:0)); diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index bbeb5997f..746e866b8 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -789,15 +789,6 @@ void SV_SetupNetworkBuffers(qboolean bigcoords) #endif #ifdef Q2SERVER - sv.q2datagram.maxsize = sizeof(sv.q2datagram_buf); - sv.q2datagram.data = sv.q2datagram_buf; - sv.q2datagram.allowoverflow = true; - sv.q2datagram.prim = svs.netprim; - - sv.q2reliable_datagram.maxsize = sizeof(sv.q2reliable_datagram_buf); - sv.q2reliable_datagram.data = sv.q2reliable_datagram_buf; - sv.q2reliable_datagram.prim = svs.netprim; - sv.q2multicast.maxsize = sizeof(sv.q2multicast_buf); sv.q2multicast.data = sv.q2multicast_buf; sv.q2multicast.prim = svs.netprim; diff --git a/engine/server/sv_send.c b/engine/server/sv_send.c index 25e95934b..99fc58832 100644 --- a/engine/server/sv_send.c +++ b/engine/server/sv_send.c @@ -1516,7 +1516,7 @@ void SV_SendFixAngle(client_t *client, sizebuf_t *msg, int fixtype, qboolean rol client_t *controller = client->controller?client->controller:client; edict_t *ent = client->edict; pvec_t *ang; - if (!ent || client->protocol == SCP_QUAKE2) + if (!ent || ISQ2CLIENT(client)) return; ang = ent->v->fixangle?ent->v->angles:ent->v->v_angle; //angles is just WEIRD for mdls, but then quake sucks. if (ent->v->movetype == MOVETYPE_6DOF) @@ -2792,22 +2792,8 @@ void SV_FlushBroadcasts (void) if (client->protocol == SCP_BAD) continue; //botclient -#ifdef Q2SERVER - if (ISQ2CLIENT(client)) - { - ClientReliableCheckBlock(client, sv.q2reliable_datagram.cursize); - ClientReliableWrite_SZ(client, sv.q2reliable_datagram.data, sv.q2reliable_datagram.cursize); - - if (client->state != cs_spawned) - continue; // datagrams only go to spawned - SZ_Write (&client->datagram - , sv.q2datagram.data - , sv.q2datagram.cursize); - } - else -#endif #ifdef NQPROT - if (!ISQWCLIENT(client)) + if (ISNQCLIENT(client)) { if (client->pextknown) { @@ -2845,10 +2831,6 @@ void SV_FlushBroadcasts (void) SZ_Clear (&sv.nqreliable_datagram); SZ_Clear (&sv.nqdatagram); #endif -#ifdef Q2SERVER - SZ_Clear (&sv.q2reliable_datagram); - SZ_Clear (&sv.q2datagram); -#endif } static qboolean SV_SyncInfoBuf(client_t *client) @@ -2866,7 +2848,7 @@ static qboolean SV_SyncInfoBuf(client_t *client) qboolean final; sizebuf_t *buf; - if (client->protocol == SCP_QUAKE2) + if (ISQ2CLIENT(client)) { //q2 gamecode is fully responsible for networking this via configstrings. InfoSync_Clear(&client->infosync); return false; @@ -3272,10 +3254,6 @@ void SV_UpdateToReliableMessages (void) if (sv.nqdatagram.overflowed) SZ_Clear (&sv.nqdatagram); #endif -#ifdef Q2SERVER - if (sv.q2datagram.overflowed) - SZ_Clear (&sv.q2datagram); -#endif SV_FlushBroadcasts(); }