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);
}
}
}
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))
{
{
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();
}
}
{
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);
}
}
{
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)
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;
}
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:
{
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;
getstring(ans, p, sizeof(ans));
if(!answerchallenge(ci, id, ans, desc))
{
- disconnect_client(sender, ci->connectauth);
+ //~disconnect_client(sender, ci->connectauth);
return;
}
break;
break;
default:
- disconnect_client(sender, DISC_MSGERR);
+ //~disconnect_client(sender, DISC_MSGERR);
return;
}
return;
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;
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);
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])
{