From 5f30982cfb6ab3795b63e30fb761eb58dafb1538 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Tue, 8 Jun 2021 03:16:13 +0200 Subject: [PATCH] feat: added userCount and containsConnection methods to UserManager --- .../marvelous/server/netconnector/UserManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/UserManager.java b/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/UserManager.java index 4a872de..b2a774c 100644 --- a/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/UserManager.java +++ b/Server/src/main/java/uulm/teamname/marvelous/server/netconnector/UserManager.java @@ -265,4 +265,13 @@ public class UserManager { client.socket.close(CloseFrame.NORMAL); } + + + public int getUserCount() { + return clients.size(); + } + + public boolean containsConnection(WebSocket conn) { + return clients.containsKey(conn); + } }