Exemplo n.º 1
0
        public static Level GetPlayer(long id, bool persistent = false)
        {
            Level level = ResourcesManager.GetInMemoryPlayer(id);

            if (level == null)
            {
                level = ResourcesManager.m_vDatabase.GetAccount(id);
                if (persistent)
                {
                    ResourcesManager.LoadLevel(level);
                }
            }
            return(level);
        }
Exemplo n.º 2
0
        public static void LogPlayerIn(Level level, Client client)
        {
            level.SetClient(client);
            client.SetLevel(level);
            level.SetIPAddress(client.CIPAddress);
            object vOnlinePlayersLock = ResourcesManager.m_vOnlinePlayersLock;

            lock (vOnlinePlayersLock)
            {
                if (!ResourcesManager.m_vOnlinePlayers.Contains(level))
                {
                    ResourcesManager.m_vOnlinePlayers.Add(level);
                    ResourcesManager.LoadLevel(level);
                }
            }
        }