]> git.xolatile.top Git - xolatile-badassbug.git/commitdiff
No disconnections...
authorxolatile <xolatile@proton.me>
Mon, 4 Aug 2025 17:02:58 +0000 (19:02 +0200)
committerxolatile <xolatile@proton.me>
Mon, 4 Aug 2025 17:02:58 +0000 (19:02 +0200)
src/fpsgame/server.cpp

index 08316d8b8e5a796bd2c40e4bc6dcd71bf7266a41..a3f04816e451174818e4da1b648445fc28bcb49f 100644 (file)
@@ -419,7 +419,7 @@ namespace server
             clientinfo &c = *clients[i];
             if(c.state.aitype != AI_NONE || c.privilege >= PRIV_ADMIN || c.local) continue;
             if(actor && ((c.privilege > priv && !actor->local) || c.clientnum == actor->clientnum)) continue;
-            if(getclientip(c.clientnum) == ip) disconnect_client(c.clientnum, DISC_KICK);
+            //~if(getclientip(c.clientnum) == ip) disconnect_client(c.clientnum, DISC_KICK);
         }
     }
 
@@ -2436,7 +2436,7 @@ namespace server
         }
 
         while(bannedips.length() && bannedips[0].expire-totalmillis <= 0) bannedips.remove(0);
-        loopv(connects) if(totalmillis-connects[i]->connectmillis>15000) disconnect_client(connects[i]->clientnum, DISC_TIMEOUT);
+        //~loopv(connects) if(totalmillis-connects[i]->connectmillis>15000) disconnect_client(connects[i]->clientnum, DISC_TIMEOUT);
 
         if(nextexceeded && gamemillis > nextexceeded && (!m_timed || gamemillis < gamelimit))
         {
@@ -2445,7 +2445,7 @@ namespace server
             {
                 clientinfo &c = *clients[i];
                 if(c.state.aitype != AI_NONE) continue;
-                if(c.checkexceeded()) disconnect_client(c.clientnum, DISC_MSGERR);
+                //~if(c.checkexceeded()) disconnect_client(c.clientnum, DISC_MSGERR);
                 else c.scheduleexceeded();
             }
         }
@@ -2656,7 +2656,7 @@ namespace server
         {
             clientinfo *ci = clients[i];
             if(ci->state.aitype != AI_NONE || ci->local || ci->privilege >= PRIV_ADMIN) continue;
-            if(checkbans(getclientip(ci->clientnum))) disconnect_client(ci->clientnum, DISC_IPBAN);
+            //~if(checkbans(getclientip(ci->clientnum))) disconnect_client(ci->clientnum, DISC_IPBAN);
         }
     }
 
@@ -2697,7 +2697,7 @@ namespace server
     {
         if(!ci) return;
         ci->cleanauth();
-        if(ci->connectauth) disconnect_client(ci->clientnum, ci->connectauth);
+        //~if(ci->connectauth) disconnect_client(ci->clientnum, ci->connectauth);
     }
 
     void authfailed(uint id)
@@ -2754,7 +2754,7 @@ namespace server
             sendf(ci->clientnum, 1, "ris", N_SERVMSG, "not connected to authentication server");
         }
         if(ci->authreq) return true;
-        if(ci->connectauth) disconnect_client(ci->clientnum, ci->connectauth);
+        //~if(ci->connectauth) disconnect_client(ci->clientnum, ci->connectauth);
         return false;
     }
 
@@ -2891,7 +2891,7 @@ namespace server
         if(ci && !ci->connected)
         {
             if(chan==0) return;
-            else if(chan!=1) { disconnect_client(sender, DISC_MSGERR); return; }
+            //~else if(chan!=1) { disconnect_client(sender, DISC_MSGERR); return; }
             else while(p.length() < p.maxlen) switch(checktype(getint(p), ci))
             {
                 case N_CONNECT:
@@ -2911,7 +2911,7 @@ namespace server
                     {
                         if(disc == DISC_LOCAL || !serverauth[0] || strcmp(serverauth, authdesc) || !tryauth(ci, authname, authdesc))
                         {
-                            disconnect_client(sender, disc);
+                            //~disconnect_client(sender, disc);
                             return;
                         }
                         ci->connectauth = disc;
@@ -2928,7 +2928,7 @@ namespace server
                     getstring(ans, p, sizeof(ans));
                     if(!answerchallenge(ci, id, ans, desc))
                     {
-                        disconnect_client(sender, ci->connectauth);
+                        //~disconnect_client(sender, ci->connectauth);
                         return;
                     }
                     break;
@@ -2939,7 +2939,7 @@ namespace server
                     break;
 
                 default:
-                    disconnect_client(sender, DISC_MSGERR);
+                    //~disconnect_client(sender, DISC_MSGERR);
                     return;
             }
             return;
@@ -3623,11 +3623,11 @@ namespace server
             case N_EDITVSLOT:
             {
                 int size = server::msgsizelookup(type);
-                if(size<=0) { disconnect_client(sender, DISC_MSGERR); return; }
+                //~if(size<=0) { disconnect_client(sender, DISC_MSGERR); return; }
                 loopi(size-1) getint(p);
-                if(p.remaining() < 2) { disconnect_client(sender, DISC_MSGERR); return; }
+                //~if(p.remaining() < 2) { disconnect_client(sender, DISC_MSGERR); return; }
                 int extra = lilswap(*(const ushort *)p.pad(2));
-                if(p.remaining() < extra) { disconnect_client(sender, DISC_MSGERR); return; }
+                //~if(p.remaining() < extra) { disconnect_client(sender, DISC_MSGERR); return; }
                 p.pad(extra);
                 if(ci && ci->state.state!=CS_SPECTATOR) QUEUE_MSG;
                 break;
@@ -3642,7 +3642,7 @@ namespace server
                     if(packlen > 0) p.subbuf(packlen);
                     break;
                 }
-                if(p.remaining() < packlen) { disconnect_client(sender, DISC_MSGERR); return; }
+                //~if(p.remaining() < packlen) { disconnect_client(sender, DISC_MSGERR); return; }
                 packetbuf q(32 + packlen, ENET_PACKET_FLAG_RELIABLE);
                 putint(q, type);
                 putint(q, ci->clientnum);
@@ -3659,17 +3659,17 @@ namespace server
 
 
             case -1:
-                disconnect_client(sender, DISC_MSGERR);
+                //~disconnect_client(sender, DISC_MSGERR);
                 return;
 
             case -2:
-                disconnect_client(sender, DISC_OVERFLOW);
+                //~disconnect_client(sender, DISC_OVERFLOW);
                 return;
 
             default: genericmsg:
             {
                 int size = server::msgsizelookup(type);
-                if(size<=0) { disconnect_client(sender, DISC_MSGERR); return; }
+                //~if(size<=0) { disconnect_client(sender, DISC_MSGERR); return; }
                 loopi(size-1) getint(p);
                 if(ci) switch(msgfilter[type])
                 {