How can i add command to banned IP?

01/26/2012 18:57 florin2012#1
Hye all i have one question how can i ban peopel with IP
banned IP how can ?
i m use source version 5525+ please i need guide!!!
01/26/2012 19:03 pro4never#2
#moved

At least post in the private server section rofl.

As for the question...


#1: Write a method to look up IP by player name (if they are online. If not you may want a "last ip" field in your accounts database so you can ip ban people who are not currently online)

#2: Make a database or text file to hold all banned ips

#3: Make a list inside the source to hold this list of banned ips

#4: Make a load method to load the external textfile/database of banned ips into your internal list

#5: When receiving a connection, check if the ip is allowed. If not then disconnect them.

#6: Make a command that accepts a player name, calls the pull ip method (checks if it returns anything) and adds to the banned list and saves it to database.


DONE
01/26/2012 19:06 shadowman123#3
idk i've been tryin to do this but couldnt ...
01/26/2012 22:58 I don't have a username#4
Look in my old projectx source. I have it there, poorly coded and can be improved, but working.