private void _playButton_Clicked(Base sender, ClickedEventArgs arguments)
 {
     ChatboxMsg.ClearMessages();
     PacketSender.SendSelectCharacter(Characters[mSelectedChar].Id);
 }
        void TryRegister()
        {
            if (Globals.WaitingOnServer)
            {
                return;
            }

            if (Networking.Network.Connected)
            {
                if (FieldChecking.IsValidUsername(mUsernameTextbox.Text, Strings.Regex.username))
                {
                    if (mPasswordTextbox.Text == mPasswordTextbox2.Text)
                    {
                        if (FieldChecking.IsValidPassword(mPasswordTextbox.Text, Strings.Regex.password))
                        {
                            if (FieldChecking.IsWellformedEmailAddress(mEmailTextbox.Text, Strings.Regex.email))
                            {
                                Hide();

                                //Hash Password
                                using (var sha = new SHA256Managed())
                                {
                                    var hashedPass = BitConverter.ToString(
                                        sha.ComputeHash(Encoding.UTF8.GetBytes(mPasswordTextbox.Text.Trim()))
                                        )
                                                     .Replace("-", "");

                                    PacketSender.SendCreateAccount(
                                        mUsernameTextbox.Text, hashedPass, mEmailTextbox.Text
                                        );
                                }

                                Globals.WaitingOnServer = true;
                                mRegisterBtn.Disable();
                                ChatboxMsg.ClearMessages();
                            }
                            else
                            {
                                Interface.MsgboxErrors.Add(
                                    new KeyValuePair <string, string>("", Strings.Registration.emailinvalid)
                                    );
                            }
                        }
                        else
                        {
                            Interface.MsgboxErrors.Add(
                                new KeyValuePair <string, string>("", Strings.Errors.passwordinvalid)
                                );
                        }
                    }
                    else
                    {
                        Interface.MsgboxErrors.Add(
                            new KeyValuePair <string, string>("", Strings.Registration.passwordmatch)
                            );
                    }
                }
                else
                {
                    Interface.MsgboxErrors.Add(new KeyValuePair <string, string>("", Strings.Errors.usernameinvalid));
                }
            }
            else
            {
                Interface.MsgboxErrors.Add(new KeyValuePair <string, string>("", Strings.Errors.notconnected));
            }
        }