Ejemplo n.º 1
0
        public static void CreateCharacter(IConnection connection, PlayerData playerData)
        {
            if (connection.GameAccount.Players.Count >= 8
                || PlayerService.CheckName(playerData.Name, 1) != CheckNameResult.Ok
                || !PlayerService.CheckNameForUse(playerData.Name, 1))
            {
                FeedbackService.SendCreateCharacterResult(connection, false);
                return;
            }

            Player player = PlayerService.CreateCharacter(connection, playerData);
            StorageService.AddStartItemsToPlayer(player);

            FeedbackService.SendCreateCharacterResult(connection, true);

            UsedPlayerNames.Add(playerData.Name.ToLower());
        }
Ejemplo n.º 2
0
        public override void Release()
        {
            ObservedCreature = null;

            Inventory.Release();
            Inventory = null;

            PlayerData = null;

            try
            {
                Visible.Stop();
                Visible.Release();
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
                //Already stoped
            }
            Visible = null;

            Skills = null;

            Quests = null;

            if (CurrentDialog != null)
                CurrentDialog.Release();

            if (Pet != null)
                Pet.Release();
            Pet = null;

            MarkedCreatures = null;

            TeleportLoadMapEvent = null;

            try
            {
                SystemWindowsTimer.Stop();
                SystemWindowsTimer.Dispose();
            }
                // ReSharper disable EmptyGeneralCatchClause
            catch
                // ReSharper restore EmptyGeneralCatchClause
            {
            }
            SystemWindowsTimer = null;

            BlockersInChat = null;

            Friends = null;

            base.Release();
        }
Ejemplo n.º 3
0
        public Player CreateCharacter(IConnection connection, PlayerData playerData)
        {
            Player player = new Player
            {
                PlayerData = playerData,
                AccountName = connection.GameAccount.Username,
                Position = new WorldPosition
                {
                    MapId = 13,
                    X = 93492.0F,
                    Y = -88216.0F,
                    Z = -4523.0F,
                    Heading = unchecked((short)0x8000),
                },
            };

            player.Id = DAOManager.playerDAO.SaveNewPlayer(player);
            connection.GameAccount.Players.Add(player);
            return player;
        }