msg wont be sent to self from server now even when not in lobby

This commit is contained in:
Sebastian Lenzlinger 2022-04-18 14:49:37 +02:00
parent 1943e8c86b
commit 5e50905f81

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);
}