예제 #1
0
        protected virtual void OnJoinResult(ReceivedJoinResultEventArgs e)
        {
            var join = this.ReceivedJoinResult;

            if (join != null)
            {
                join(this, e);
            }
        }
예제 #2
0
        internal void OnJoinResultMessage(MessageEventArgs <JoinResultMessage> e)
        {
            var msg = (JoinResultMessage)e.Message;

            if (msg.Result == LoginResultState.Success)
            {
                this.UserId           = msg.UserInfo.UserId;
                this.Username         = msg.UserInfo.Username;
                this.Nickname         = msg.UserInfo.Nickname;
                this.CurrentChannelId = msg.UserInfo.CurrentChannelId;
            }

            var args = new ReceivedJoinResultEventArgs(msg.Result);

            OnJoinResult(args);
        }
예제 #3
0
        private void ReconnectJoinedResult(object sender, ReceivedJoinResultEventArgs e)
        {
            if (e.Result != LoginResultState.Success)
            {
                return;
            }

            IChannelInfo channel = this.Channels[this.disconnectedInChannelId];

            if (channel != null)
            {
                this.Users.Move(this.CurrentUser, channel);
            }

            this.disconnectedInChannelId = 0;
        }
예제 #4
0
 protected virtual void OnJoinResult(ReceivedJoinResultEventArgs e)
 {
     var join = this.ReceivedJoinResult;
     if (join != null)
         join (this, e);
 }
예제 #5
0
        internal void OnJoinResultMessage(MessageEventArgs<JoinResultMessage> e)
        {
            var msg = (JoinResultMessage)e.Message;
            if (msg.Result == LoginResultState.Success)
            {
                this.UserId = msg.UserInfo.UserId;
                this.Username = msg.UserInfo.Username;
                this.Nickname = msg.UserInfo.Nickname;
                this.CurrentChannelId = msg.UserInfo.CurrentChannelId;
            }

            var args = new ReceivedJoinResultEventArgs(msg.Result);
            OnJoinResult (args);
        }
예제 #6
0
파일: MainForm.cs 프로젝트: ermau/Gablarski
		async void CurrentUserReceivedJoinResult (object sender, ReceivedJoinResultEventArgs e)
		{
			if (e.Result != LoginResultState.Success)
			{
				string reason = e.Result.ToString ();
				switch (e.Result)
				{
					case LoginResultState.FailedUsernameAndPassword:
						reason = "Username and password combination not found.";
						break;

					case LoginResultState.FailedUsername:
						reason = "This server requires a user login.";
						break;

					case LoginResultState.FailedServerPassword:
						reason = "The server password supplied was incorrect.";
						break;

					case LoginResultState.FailedNicknameInUse:
						reason = "The nickname supplied is already in use.";
						break;

					case LoginResultState.FailedPassword:
						reason = "The password for the username supplied was incorrect.";
						break;

					case LoginResultState.FailedBanned:
						reason = "You have been banned from this server.";
						break;
				}

				Action<Form, string> d = (f, m) => MessageBox.Show (f, m, "Joining", MessageBoxButtons.OK, MessageBoxIcon.Error);
				BeginInvoke (d, this, "Join failed: " + reason);
				await gablarski.DisconnectAsync();
			}
			else
			{
				await SetupInputAsync();

				if (!this.gablarski.CurrentUser.IsRegistered && this.gablarski.ServerInfo.RegistrationMode != UserRegistrationMode.None)
					BeginInvoke ((Action)(() => btnRegister.Visible = true ));

				this.gablarski.Sources.Request ("voice", AudioFormat.Mono16bitLPCM, 480);
			}
		}