Пример #1
0
        /// <summary>
        /// Client wants to select a character and go to the square list.
        /// </summary>
        /// <param name="packet"></param>
        void OnSelectCharacter(PacketReader packet)
        {
            if (!IsAuthenticated)
            {
                return;
            }

            string characterName = packet.ReadUTF16();

            foreach (var character in Account.Characters)
            {
                if (character.Name == characterName)
                {
                    Character = character;

                    Server.Database.AssignCharacterToSession(Key, characterName);

                    Send(PacketGenerator.CharacterSelect(0, characterName));
                    return;
                }
            }
            Send(PacketGenerator.CharacterSelect(1, characterName));
        }