protected virtual void OnLoginResult(ReceivedLoginResultEventArgs e) { var result = this.ReceivedLoginResult; if (result != null) { result(this, e); } }
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); }
protected virtual void OnLoginResult(ReceivedLoginResultEventArgs e) { var result = this.ReceivedLoginResult; if (result != null) result (this, e); }
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); }
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); } }