Skip to content

Commit d594473

Browse files
committed
fix connection status checks
1 parent 129f9ae commit d594473

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codemp/server/sv_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,11 @@ void SV_DirectConnect( netadr_t from ) {
320320
// check for > sv_maxConnPerIP connections from same IP
321321
int count = 0, i = 0;
322322
for (i = 0, cl = svs.clients; i < sv_maxclients->integer; i++, cl++) {
323-
if (NET_CompareBaseAdr(svs.clients[clientNum].netchan.remoteAddress, svs.clients[i].netchan.remoteAddress)) {
323+
if (cl->state >= CS_CONNECTED && NET_CompareBaseAdr(svs.clients[clientNum].netchan.remoteAddress, svs.clients[i].netchan.remoteAddress)) {
324324
count++;
325325
}
326326
}
327-
if (count > sv_maxConnPerIP->integer) {
327+
if (count >= sv_maxConnPerIP->integer) {
328328
cl->state = CS_FREE;
329329
denied = "Too many connections from the same IP";
330330
NET_OutOfBandPrint(NS_SERVER, from, "print\n%s\n", denied);

0 commit comments

Comments
 (0)