Server will not admit any clients whose IP is on the banned.txt list.
This commit is contained in:
parent
4b9f582fd0
commit
376a626506
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user