Merge remote-tracking branch 'origin/master'

This commit is contained in:
Seraina 2022-04-18 15:23:52 +02:00
commit df3964a9fa

View File

@ -184,6 +184,9 @@ public class ClientHandler implements Runnable {
} else {
//send msg to all clients who are not in a lobby.
for (ClientHandler client : connectedClients) {
if(client.getClientUserName().equals(this.getClientUserName())){
continue;
}
if (Lobby.clientIsInLobby(client) == -1) {
client.sendMsgToClient(Protocol.printToClientChat + "$" + clientUserName + ": " + msg);
}
@ -213,6 +216,9 @@ public class ClientHandler implements Runnable {
*/
public void broadcastChatMessageToAll(String msg) {
for (ClientHandler client : connectedClients) {
if(client.getClientUserName().equals(this.getClientUserName())){
continue;
}
client.sendMsgToClient(Protocol.printToClientChat + "$" + clientUserName + ": " + msg);
}
}