diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 42ff6a1..e310d66 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,6 @@ - @@ -15,11 +14,11 @@ - + - - + + @@ -35,11 +34,21 @@ - + - - + + + + + + + + + + + + @@ -279,16 +288,15 @@ - - @@ -338,26 +346,34 @@ - + - - + + - + - - + + - + + + + + + + + + - - + + diff --git a/out/production/ChatSystem/Server/AccountHandler.class b/out/production/ChatSystem/Server/AccountHandler.class index 502e2c6..2b12a3d 100644 Binary files a/out/production/ChatSystem/Server/AccountHandler.class and b/out/production/ChatSystem/Server/AccountHandler.class differ diff --git a/src/Server/AccountHandler.java b/src/Server/AccountHandler.java index ec5f5b4..aa78bba 100644 --- a/src/Server/AccountHandler.java +++ b/src/Server/AccountHandler.java @@ -94,7 +94,7 @@ public void run() { write(); try { int available = input.available(); - while (available != 0) { + while (available != 0 && running) { available = input.available(); byte[] bytes = new byte[available]; input.read(bytes); @@ -178,7 +178,6 @@ private void processMessage(String s) { sendData(commands); break; case "$DISCONNECT": - sendToChatroom(s); close(); break; case "$USERLIST": // username = ipaddress .... @@ -280,10 +279,10 @@ private synchronized void close() { return; } setRunning(false); - for (int i = 0; i < chatrooms.size(); i++) { + /*for (int i = 0; i < chatrooms.size(); i++) { chatrooms.get(i).sendToAll(Server.NAME + Server.getTime() + name + " has disconnected." + chatrooms.get(i).name()); chatrooms.get(i).removeUser(name); - } + }*/ try { System.out.println("Closing socket to " + name); output.close();