Esempio n. 1
0
        /// <summary>
        /// Client attempts to delete a character.
        /// </summary>
        /// <param name="packet"></param>
        void OnDeleteCharacter(PacketReader packet)
        {
            if (!IsAuthenticated)
            {
                return;
            }

            // Attempt to the delete the character.
            string characterName = packet.ReadUTF16();

            foreach (var character in Account.Characters)
            {
                if (character.Name == characterName)
                {
                    Server.Database.DeleteCharacter(characterName);

                    Send(PacketGenerator.CharacterDelete(0, characterName));

                    return;
                }
            }
            Send(PacketGenerator.CharacterDelete(1, characterName));
        }