diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/MarvelousServer.java b/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/MarvelousServer.java index ca30d06..1a761e8 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/MarvelousServer.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/MarvelousServer.java @@ -12,19 +12,19 @@ public class MarvelousServer extends WebSocketServer { @Override public void onOpen(WebSocket conn, ClientHandshake handshake) { Logger.info("New client connected. Adding new User."); - userManager.connectUser(conn); + UserManager.getInstance().connectUser(conn); } @Override public void onClose(WebSocket conn, int code, String reason, boolean remote) { Logger.info("Client disconnected"); - userManager.disconnectUser(conn, remote); + UserManager.getInstance().disconnectUser(conn, remote); } @Override public void onMessage(WebSocket conn, String message) { Logger.debug("Message received: {}", message); - userManager.messageReceived(conn, message); + UserManager.getInstance().messageReceived(conn, message); } @Override @@ -37,16 +37,7 @@ public class MarvelousServer extends WebSocketServer { Logger.info("MarvelousServer started on Address {}", this.getAddress().toString()); } - private final UserManager userManager; - public MarvelousServer(InetSocketAddress address) { super(address); - this.userManager = new UserManager(); - } - - /** Practically No-Arg constructor for testing. NEVER USE ANYWHERE ELSE! - * @param userManager*/ - protected MarvelousServer(UserManager userManager) { super(); - this.userManager = userManager; } }