Add a rule, MaxClientsSimplifiedLogic which allows for P99-style IP restrictions if enabled. Opcode handler for OP_WorldLogout in char sel.

Only uses ExemptAccountLimitStatus and MaxClientsPerIP. Also adds in an
opcode handler so CLEs are cleaned up at char select when ESC is
pressed.
This commit is contained in:
E Spause
2017-03-12 23:19:24 -04:00
parent 3fa72218a4
commit 3dd0d43e96
5 changed files with 41 additions and 1 deletions
+15
View File
@@ -134,11 +134,26 @@ bool LoginServer::Process() {
if( (int32)numplayers >= x && x != -1 && x != 255 && status < 80)
utwrs->response = -3;
if (pack->size == sizeof(UsertoWorldRequest_Struct))
{
uint32 decimalIP = inet_addr(utwr->IPAddr);
if (RuleB(World, MaxClientsSimplifiedLogic)) {
if (client_list.GetCLEIPCount(decimalIP) >= (RuleI(World, MaxClientsPerIP))) {
if ((status < (RuleI(World, ExemptMaxClientsStatus))) || (RuleI(World, ExemptMaxClientsStatus) < 0)) {
utwrs->response = -4;
}
}
}
}
if(status == -1)
utwrs->response = -1;
if(status == -2)
utwrs->response = -2;
utwrs->worldid = utwr->worldid;
SendPacket(outpack);
delete outpack;