public static void OnClose(WsConnection c) { lock (_sync) { Connections.Remove(c); } }
public static void Start() { _server.Start(c => { var wsConn = new WsConnection(c); c.OnOpen += () => OnOpen(wsConn); c.OnClose += () => OnClose(wsConn); }); Log.InfoFormat("Web server started."); }
public static void OnOpen(WsConnection c) { lock (_sync) { Connections.Add(c); /*c.SendPacket(new MapConfigPacket() * { * Config = MiMapConfig.Config * }); * * foreach (var levelRunner in MiMapPlugin.Instance.LevelRunners) * { * c.SendPacket(new LevelMetaPacket() * { * LevelId = levelRunner.Map.Meta.Id, * Meta = levelRunner.Map.Meta * }); * }*/ } }