nice rep++ (dont gonna use)
|
Firstly, FindBelow it, addCode:String connectingHost = s.getInetAddress().getHostName();Now, aboveCode:if(blocked == true) { s.close(); }addCode:public void run() {Adding new bans is really simple, just add a new ,"HOSTNAMEHERE" to the array.Code:public boolean blocked = false; public String hostBans[] = {"127.0.0.1", "localhost", "www.routerlogin.com"}; //these are examples, remove them or you wont be able to log on from your local computer. public void checkHost(String connectingHost) { for(int chk = 0; chk < hostBans.length; chk++) { if(connectingHost.startsWith(hostBans[chk])) { blocked = true; } } }
nice rep++ (dont gonna use)
cool much better than my current ip ban, but is there any way to make this add ips through a command? I am quite often not at home, where my server is, when I need to ip ban someone, so that would be great.
Could I just make it read from my current txt file?
No, it would still work much better than other IP bans, just be a lot easier to manipulate.
did u ever find a way to add ur bannedips.txt?
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
Tags for this Thread |