Limiting client connections by IP address (Integrated into Rules System)
I've seen several people asking / talking about limiting client connections by IP address lately, so I figure I'd just post my implementation of it. Give it a try and let me know what you think.
.\common\ruletypes.h Change: Code:
RULE_CATEGORY( World ) Code:
RULE_CATEGORY( World ) .\world\clientlist.h Change: Code:
void ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* scl); Code:
void ClientUpdate(ZoneServer* zoneserver, ServerClientList_Struct* scl); After: Code:
void ClientList::CLERemoveZSRef(ZoneServer* iZS) { Code:
//Lieka Edit Begin: Check current CLE Entry IPs against incoming connection .\world\client.cpp After: Code:
case OP_EnterWorld: // Enter world Code:
Code:
Insert into rule_values values (0, 'World:MaxClientsPerIP', -1); World:MaxClientsPerIP = Maximum number of simultaneous EQ Client connections allowed per IP address. Set the rule value to -1 to disable this feature. World:ExemptMaxClientsStatus = Minimum Account status to exempt the MaxClientsPerIP rule. This is helpful for the inevitable random family of 16 that live together, and all want to play on your server, as well as GMs, Devs, and QA staff. Again, set the rule value to -1 to disable this feature. It's commented throughout, but let me know if you have questions. Thanks, Dax |
very much appreciated sir, will get back to you on how it works ;)
|
Request
Would it now be possible to BAN by IP with some modifications to this code. I know we can ban by account name but it sure would be handy to have a table with banned IP's to check against the login process.
Thanks Krusher |
Wow! This would be an awesome addition to the next patch update! *hint hint* Very nice work yet again!
If the new rules you have been making and the new stuff KLS has been working on all goes in, this will be the best code update in a while! Getting a little antsy :D Also, the idea Krusher has is a great one too! You would need a new table for it to reference for IPs. But then again, I wouldn't mind having IP addresses listed in a new table that matches accounts to IPs. It would be awesome for keeping track of the "bad" players. As of now, I have to catch them when they are on and do a #iplookup. If this table was put in, you could then just have a field for blocking that IP. Maybe even a new in-game command #ipblock <IP Address>. I have IP blockers and even some built into my router, but it would be nice if it could just be done directly from the server tables. |
I've been thinking about doing that for a while, but haven't gotten around to coding it. Right now we just ban IPs at the firewall when we need to, but being able to do it from within the database would be a pretty nice addition. I might just look into that.
Dax |
Thanks for your code Dax. I wish more people would post thier code changes for others who might want to integrate them.
|
Quote:
Although, I think blocking at the router is probably a better idea. Dont even let them near your server. Keeps the vengeful hackers further away. Only down side is if your router either doesnt support this or you run out of blockable IPs in the router. |
You see, that's what I'm talking about!
Thanks for the fix, I hope we get it into the source soon |
Excited for this to go in, thanks for sharing!
|
/applauds
Boxers! Beware.. Mha-ha-ha-ha :cool: |
Quote:
http://www.eqemulator.net/forums/showthread.php?t=24748 |
I was double checking this submission against the current release, and saw that I had a couple of issues with it. Here are the corrections. Sorry about that. ;)
This portion had a typo in it: .\world\clientlist.cpp After: Code:
void ClientList::CLERemoveZSRef(ZoneServer* iZS) { Add: Code:
//Lieka Edit Begin: Check current CLE Entry IPs against incoming connection .\world\clientlist.h After: Code:
#include "../common/eq_packet_structs.h" Code:
#include "../common/rulesys.h" |
Please! I don't want to shut this thread down - post here only if you have a reasonable fix to this submission. Other than that, you can post comments here;
http://eqemulator.net/forums/showthr...t=24787&page=2 Again, this forum is intended for submissions only |
All times are GMT -4. The time now is 11:28 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.