public virtual void AppendRemovePlayer(Player player, bool reset) { lock (lockThis) { if (reset) { AppendRemoveCreature(player); playersOnline.Remove(player.Name.ToLower()); player.ResetStats(); player.SavePlayer(); } else { player.SavePlayer(); AppendRemoveCreature(player); playersOnline.Remove(player.Name.ToLower()); } } }
/// <summary> /// Accept incoming connection requests. /// </summary> private void AcceptConnections() { // TODO: Remove! Player player = new Player(null); player.Name = "Ivan"; player.Password = Hash.GetSha256("Ivan"); player.CurrentPosition = new Position(32369, 32241, 7); player.MaxCapacity = 420; //TODO: Verify if correct player.MagicLevel = 1; player.MaxHP = 150; player.CurrentHP = 150; player.MaxMana = 0; player.CurrentMana = 0; player.CurrentVocation = Vocation.NONE; player.BaseSpeed = 220; player.SavePlayer(); while (true) { #if DEBUG // TODO: Write message here ("accept connections") #endif HandleConnection(); } }