mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 15:58:36 +00:00
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:
+18
-1
@@ -214,6 +214,24 @@ void ClientList::GetCLEIP(uint32 iIP) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32 ClientList::GetCLEIPCount(uint32 iIP) {
|
||||
ClientListEntry* countCLEIPs = 0;
|
||||
LinkedListIterator<ClientListEntry*> iterator(clientlist);
|
||||
|
||||
int IPInstances = 0;
|
||||
iterator.Reset();
|
||||
|
||||
while (iterator.MoreElements()) {
|
||||
countCLEIPs = iterator.GetData();
|
||||
if ((countCLEIPs->GetIP() == iIP) && ((countCLEIPs->Admin() < (RuleI(World, ExemptMaxClientsStatus))) || (RuleI(World, ExemptMaxClientsStatus) < 0)) && countCLEIPs->Online() >= CLE_Status_Online) { // If the IP matches, and the connection admin status is below the exempt status, or exempt status is less than 0 (no-one is exempt)
|
||||
IPInstances++; // Increment the occurences of this IP address
|
||||
}
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
return IPInstances;
|
||||
}
|
||||
|
||||
void ClientList::DisconnectByIP(uint32 iIP) {
|
||||
ClientListEntry* countCLEIPs = 0;
|
||||
LinkedListIterator<ClientListEntry*> iterator(clientlist);
|
||||
@@ -252,7 +270,6 @@ ClientListEntry* ClientList::FindCharacter(const char* name) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ClientListEntry* ClientList::FindCLEByAccountID(uint32 iAccID) {
|
||||
LinkedListIterator<ClientListEntry*> iterator(clientlist);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user