Ejemplo n.º 1
0
 public static void OnClose(WsConnection c)
 {
     lock (_sync)
     {
         Connections.Remove(c);
     }
 }
Ejemplo n.º 2
0
        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.");
        }
Ejemplo n.º 3
0
        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
                 *  });
                 * }*/
            }
        }