diff --git a/src/main/java/ChatServer.java b/src/main/java/ChatServer.java index e9cfb35..f43051b 100644 --- a/src/main/java/ChatServer.java +++ b/src/main/java/ChatServer.java @@ -39,10 +39,10 @@ public class ChatServer { } // Methode, um eine Nachricht an alle verbundenen Clients zu senden public void broadcastMessage(String message) { - System.out.println(message); - if (message != null) { - for (ClientHandler client : clients) { - client.sendMessage(message); // Nachricht an jeden Client senden + System.out.println(message); + if (message != null) { + for (ClientHandler client : clients) { + client.sendMessage(message); } } diff --git a/src/main/java/ClientHandler.java b/src/main/java/ClientHandler.java index d443891..edba43c 100644 --- a/src/main/java/ClientHandler.java +++ b/src/main/java/ClientHandler.java @@ -14,7 +14,7 @@ public class ClientHandler implements Runnable { public ClientHandler(ChatServer chatServer, Socket connectionToClient) { this.chatServer = chatServer; this.connectionToClient = connectionToClient; - name = JOptionPane.showInputDialog("welcher Benutzername?"); + name = JOptionPane.showInputDialog("Benutzername für neuen Client vergeben"); new Thread(this).start();} // Start a new thread for this client handler diff --git a/user.json b/user.json index 5cbff9f..0201a67 100644 --- a/user.json +++ b/user.json @@ -10,11 +10,5 @@ "userName": "asd1", "password": "123456", "birthday": "1" - }, - { - "id": "228bf4df-c730-4cd9-9d1c-2446607066aa", - "userName": "jo", - "password": "sieben", - "birthday": "jo" } ] \ No newline at end of file