Skip to content

Commit 3c3a073

Browse files
cursoragenttimfox
andcommitted
chore(server): remove dead SV_ReplacePendingServerCommands block
The helper lived under #if 0 and was never compiled; the only call site in SV_AddServerCommand was commented out. Drop the dead code and stale comments to reduce noise without changing server command behavior. Co-authored-by: Tim Fox <timfox@outlook.com>
1 parent 2db3859 commit 3c3a073

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

src/server/sv_main.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -100,39 +100,6 @@ static const char *SV_ExpandNewlines( const char *in ) {
100100
}
101101

102102

103-
/*
104-
======================
105-
SV_ReplacePendingServerCommands
106-
107-
Note: Could refactor for clarity.
108-
======================
109-
*/
110-
#if 0 // unused
111-
static int SV_ReplacePendingServerCommands( client_t *client, const char *cmd ) {
112-
int i, index, csnum1, csnum2;
113-
114-
for ( i = client->reliableSent+1; i <= client->reliableSequence; i++ ) {
115-
index = i & ( MAX_RELIABLE_COMMANDS - 1 );
116-
//
117-
if ( !Q_strncmp(cmd, client->reliableCommands[ index ], strlen("cs")) ) {
118-
sscanf(cmd, "cs %i", &csnum1);
119-
sscanf(client->reliableCommands[ index ], "cs %i", &csnum2);
120-
if ( csnum1 == csnum2 ) {
121-
Q_strncpyz( client->reliableCommands[ index ], cmd, sizeof( client->reliableCommands[ index ] ) );
122-
/*
123-
if ( client->netchan.remoteAddress.type != NA_BOT ) {
124-
Com_Printf( "WARNING: client %i removed double pending config string %i: %s\n", client-svs.clients, csnum1, cmd );
125-
}
126-
*/
127-
return qtrue;
128-
}
129-
}
130-
}
131-
return qfalse;
132-
}
133-
#endif
134-
135-
136103
/*
137104
======================
138105
SV_AddServerCommand
@@ -144,12 +111,6 @@ not have future snapshot_t executed before it is executed
144111
void SV_AddServerCommand( client_t *client, const char *cmd ) {
145112
int index, i, n;
146113

147-
// this is very ugly but it's also a waste to for instance send multiple config string updates
148-
// for the same config string index in one snapshot
149-
// if ( SV_ReplacePendingServerCommands( client, cmd ) ) {
150-
// return;
151-
// }
152-
153114
// do not send commands until the gamestate has been sent
154115
if ( client->state < CS_PRIMED )
155116
return;

0 commit comments

Comments
 (0)