using System.Net.WebSockets; namespace MauMau_Server.Websockets; public class WebsocketManager : IWebsocketManager { private static readonly Dictionary Connections = new(); public string AddConnection(WebSocket socket) { var id = Guid.NewGuid().ToString(); Connections.Add(id, socket); return id; } public WebSocket GetConnection(string id) { return Connections[id]; } public Dictionary GetAllConnections() { return Connections; } public void RemoveConnection(string id) { Connections.Remove(id); } } public interface IWebsocketManager { public string AddConnection(WebSocket socket); public WebSocket GetConnection(string id); public Dictionary GetAllConnections(); public void RemoveConnection(string id); }