Ejemplo n.º 1
0
        void ClickButton_CreateCharacter(object sender, MouseButtonEventArgs e)
        {
            var name = _txtName.Text;

            if (!GameData.UserName.IsValid(name))
            {
                SetError("Invalid character name.");
                return;
            }

            _btnCreateCharacter.IsEnabled = false;

            using (var pw = ClientPacket.CreateNewAccountCharacter(name))
            {
                _sockets.Send(pw, ClientMessageType.System);
            }
        }
Ejemplo n.º 2
0
        void ClickButton_CreateCharacter(object sender, MouseButtonEventArgs e)
        {
            var name = _txtName.Text;

            // Validate the name client-side before talking to the server
            if (!GameData.UserName.IsValid(name))
            {
                SetError(_invalidCharacterNameMessage);
                return;
            }

            // Disable the button while we wait for a response
            _btnCreateCharacter.IsEnabled = false;

            // Send request to server
            using (var pw = ClientPacket.CreateNewAccountCharacter(name))
            {
                _sockets.Send(pw, ClientMessageType.System);
            }
        }