Thanks for the post! I have been working on it some too. This is all I have come up with so far:
Code:
//Lieka Edit Begin: Check current CLE Entry IPs against incoming connection
void ClientList::GetCLEIP(int32 iIP) {
ClientListEntry* countCLEIPs = 0;
LinkedListIterator<ClientListEntry*> iterator(clientlist);
int IPInstances = 0;
iterator.Reset();
while(iterator.MoreElements()) {
countCLEIPs = iterator.GetData();
if (countCLEIPs->GetIP() == iIP) {
IPInstances++;
if (IPInstances > (((countCLEIPs->Admin() - (RuleI(World, AddMaxClientsStatus)) + (RuleI(World, MaxClientsPerIP)) + 1) && (RuleI(World, MaxClientsPerIP))) || ((RuleI(World, MaxClientsPerIP)) && (RuleI(World, AddMaxClientsStatus) < 0)))) {
countCLEIPs->SetOnline(CLE_Status_Offline);
iterator.RemoveCurrent();
}
}
iterator.Advance();
}
}
//Lieka Edit End
And, I think this should work for the most part. This stuff hurts my head to think about lol. The only part I still need to figure out is if there is a way to set it to exempt accounts that are above the AddMaxClientsStatus, but still limit them to the total count that they should be set to. The total limit for accounts over the AddMaxClientsStatus should be:
(countCLEIPs->Admin() - (RuleI(World, AddMaxClientsStatus)) + (RuleI(World, MaxClientsPerIP)) + 1)
So, if the account status is 5 and the AddMaxClientsStatus is set to 2 and the MaxClientsPerIP is set to 3, then the equation would look like:
5 - 2 + 3 + 1 = 7
So, they would be able to log in 7 accounts total which is 4 more than all normal accounts below the AddMaxClientsStatus can log in.
Another example is if the account status is 2 and the AddMaxClientsStatus is set to 2 and the MaxClientsPerIP is set to 1, then the equation would look like:
2 - 2 + 1 + 1 = 2
So, they would be able to log in 2 accounts total which is 1 more than all normal accounts below the AddMaxClientsStatus can log in.
The hard part I can't figure out is what happens if they log in multiple accounts all with different statuses on them.... Does it use the highest given account status to define the total of all accounts that can be connected, or does it go on a case by case basis. So, if you log in an account that should be limited to 4 max connections and then log in 3 accounts that are limited to 3 max, will the 4th account be able to login even though it is only individually set to allot 3 max? I am sure that if you log in 3 accounts that should be limited to 3 max and then log in a 4th that is limited to 4 max, the 4th should be able to connect without a problem.
I will test this out and report back lol. I don't think not knowing how to program is helping me, but I think the worst part is figuring out the logic of the flow process it should be using and how to handle every possible scenario :P