diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java index 9a5c7f6..4aa383e 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/lobby/Lobby.java @@ -217,25 +217,25 @@ public class Lobby { return activePlayer; } + // Note: DO NOT ADD the connection to the equals and hashcode here, otherwise they recursively call each other @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Lobby lobby = (Lobby) o; - return badRequests == lobby.badRequests && Objects.equals(gameID, lobby.gameID) && Objects.equals(connection, lobby.connection) && Objects.equals(game, lobby.game) && Objects.equals(pipeline, lobby.pipeline) && Objects.equals(activePlayer, lobby.activePlayer) && Objects.equals(pauseSegment, lobby.pauseSegment) && Objects.equals(turnTimer, lobby.turnTimer); + return badRequests == lobby.badRequests && Objects.equals(gameID, lobby.gameID) && Objects.equals(game, lobby.game) && Objects.equals(pipeline, lobby.pipeline) && Objects.equals(activePlayer, lobby.activePlayer) && Objects.equals(pauseSegment, lobby.pauseSegment) && Objects.equals(turnTimer, lobby.turnTimer); } @Override public int hashCode() { - return Objects.hash(gameID, connection, game, pipeline, activePlayer, badRequests, pauseSegment, turnTimer); + return Objects.hash(gameID, game, pipeline, activePlayer, badRequests, pauseSegment, turnTimer); } @Override public String toString() { return "Lobby{" + "gameID='" + gameID + '\'' + - ", connection=" + connection + ", game=" + game + ", pipeline=" + pipeline + ", activePlayer=" + activePlayer +