Server will not admit any clients whose IP is on the banned.txt list.

This commit is contained in:
Deathsbreed 2014-11-17 11:56:50 -06:00
parent 4b9f582fd0
commit 376a626506

View File

@ -190,6 +190,11 @@ public class Server implements Runnable {
// Add a new client
public void addThread(Socket socket) {
// If IP is banned to not admit!
for(int i = 0; i < banned.size(); i++) {
if(socket.getRemoteSocketAddress().toString().equals(banned.get(i))) return;
}
// Otherwise add them
clients.add(new ServerThread(this, socket));
try {
clients.get(clientCount).open();