示例#1
0
        protected virtual void OnLoginResult(ReceivedLoginResultEventArgs e)
        {
            var result = this.ReceivedLoginResult;

            if (result != null)
            {
                result(this, e);
            }
        }
示例#2
0
        internal void OnLoginResultMessage(MessageEventArgs <LoginResultMessage> e)
        {
            var msg = (LoginResultMessage)e.Message;

            if (msg.Result.ResultState == LoginResultState.Success)
            {
                this.UserId = msg.Result.UserId;
            }

            var args = new ReceivedLoginResultEventArgs(msg.Result);

            OnLoginResult(args);
        }
示例#3
0
 protected virtual void OnLoginResult(ReceivedLoginResultEventArgs e)
 {
     var result = this.ReceivedLoginResult;
     if (result != null)
         result (this, e);
 }
示例#4
0
        internal void OnLoginResultMessage(MessageEventArgs<LoginResultMessage> e)
        {
            var msg = (LoginResultMessage)e.Message;
            if (msg.Result.ResultState == LoginResultState.Success)
                this.UserId = msg.Result.UserId;

            var args = new ReceivedLoginResultEventArgs (msg.Result);
            OnLoginResult (args);
        }
示例#5
0
		private void CurrentUserReceivedLoginResult (object sender, ReceivedLoginResultEventArgs e)
		{
			if (!e.Result.Succeeded)
			{
				Action<string, string, MessageBoxButtons, MessageBoxIcon> d = (m, c, b, i) => MessageBox.Show (this, m, c, b, i);

				switch (e.Result.ResultState)
				{
					case LoginResultState.FailedBanned:
						BeginInvoke (d, "You have been banned from this server.", "Login", MessageBoxButtons.OK, MessageBoxIcon.Error);
						break;

					default:
						BeginInvoke (d, "Login Failed: " + e.Result.ResultState, "Login", MessageBoxButtons.OK, MessageBoxIcon.Error);
						break;
				}

				gablarski.DisconnectAsync();
			}
			else
			{
				if (LocalServer.IsRunning)
					LocalServer.Permissions.SetAdmin (e.Result.UserId);

				string serverpassword = this.server.ServerPassword;
				if (this.gablarski.ServerInfo.Passworded && serverpassword.IsNullOrWhitespace())
					serverpassword = RequireServerPassword();

				if (this.gablarski.IsConnected)
					this.gablarski.CurrentUser.Join (this.server.UserNickname, serverpassword);
			}
		}