public MasterServer()
        {
            _users   = new Dictionary <int, MasterPlayer>();
            _players = new Dictionary <ushort, MasterPlayer>();
            ServersMgr.Add(this);
#if DEBUG
            if (!(Debug.Logger is DefaultConsoleLogger))
            {
                Debug.Logger = new DefaultConsoleLogger();
            }
#endif
        }
 private void Room_ServerStatusChanged()
 {
     if (_room.ServerStatus == ConnectionStatus.Connected)
     {
         ServersMgr.Add(this);
         _id = _room.RoomId.ToString().Normalize(8);
     }
     else
     {
         ServersMgr.Remove(this);
     }
     ServerLogger.LogServer(this, $" Status {_room.ServerStatus}");
 }
        public MasterServer()
        {
            m_bans_timer = new Timer(DeleteBansTimer, null, Timeout.Infinite, Timeout.Infinite);
            m_users      = new ConcurrentDictionary <int, MasterPlayer>();
            m_players    = new ConcurrentDictionary <ushort, MasterPlayer>();
            ServersMgr.Add(this);
#if DEBUG
            if (!(Debug.Logger is DefaultConsoleLogger))
            {
                Debug.Logger = new DefaultConsoleLogger();
            }
#endif
            m_bans_timer.Change(0, Timeout.Infinite);
        }
Beispiel #4
0
        private void Room_ServerStatusChanged()
        {
            switch (_room.ServerStatus)
            {
            case ConnectionStatus.Connected:
                ServersMgr.Add(this);
                _id = _room.RoomId.ToString().Normalize(8);
                break;

            case ConnectionStatus.Disconnecting:
                ServersMgr.Remove(this);
                break;
            }
            ServerLogger.LogServer(this, $" Status {_room.ServerStatus}");
        }