View Single Post
  #9  
Old 09-22-2008, 07:55 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I just had someone test this on my server. They were able to log in 4 accounts just fine, but when they tried to enter world on the 5th account, it caused the World Disconnect! So, this code is obviously the problem.

Now that I am looking at it again, I see that it is really done pretty badly to begin with lol. The only reason I even stickied the post was because it does include a valid fix for the current IP Limiting code, which is just changing a <= into a < check instead. That minor fix wasn't really breaking anything, but it was definitely making the rule settings misleading.

The custom code I added after that is just custom stuff I am trying to get working properly on my server. I thought it was working right until now and after further testing. I don't think it was actually working quite as I thought to begin with...

This is what I think the IP Limiting code should be doing to work how I would like to see it:

***Optional Additional Feature***
Check if a character is already logged in on this account
If so, then kick the logged in character
If no character is already logged in on this account, then continue
***Optional Additional Feature***


1. Check if there are more connections than the IP limit (MaxClientsPerIP) setting
If not, then allow them to log in.
If so, then continue

2. Check if the Account Status is >= the Additional IP Limit (AddMaxClientsStatus) Setting
If not, then IP Limit them to the IP Limit (MaxClientsPerIP) setting
If so, then continue

3. Check if there are more connections than the Additional IP Limit (AddMaxClientsPerIP) setting
If not, then allow them to log in.
If so, then continue

4. Check if the Account Status is >= the Exempt (ExemptMaxClientsStatus) setting
If not, then IP Limit them to the Additional IP Limit (AddMaxClientsPerIP) setting
If so, then allow them to log in.


Or maybe another way to do it would be:

Check Account Status
- If Status >= Exempt (ExemptMaxClientsStatus), then don't IP Limit
- If Status >= Additional IP Limit (AddMaxClientsStatus) && <= Exempt (ExemptMaxClientsStatus), then IP Limit to the Additional IP Limit (AddMaxClientsPerIP) setting
- If Status < Additional IP Limit (AddMaxClientsStatus), then IP Limit to standard IP Limit (MaxClientsPerIP) setting

I will see if I can figure out the flow of how the code should be to make one of these ways work. Really, I wouldn't mind getting another option in instead of just having a single Additional max clients and status setting. I would like for it to have a setting that just adds 1 more client for every status point over the status setting for these additional account connections.

(Account Status - AddMaxClientStatus + 1) = Total Additional Accounts Allowed Per IP. Of course you would have to check to make sure this is >= 0 otherwise any account below (AddMaxClientStatus - 1) will go into the negative. I will post the code if I figure anything out for it.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 09-23-2008 at 03:57 AM..
Reply With Quote