public void GetMessagesAsync()
 {
     ExecuteRequestAsync("UserMessage", Method.GET,
                         response =>
                         AsyncCompletedEventArgsExtensions.Raise <ICollection <UserMessageReceipt> >(
                             ReceivedMessages, response));
 }
        public void QuickLoginAsync(string username)
        {
            _isQuickLogin = true;
            var request = new RestRequest(string.Format("account/?name={0}", username), Method.POST);

            ExecuteRequestAsync(request,
                                restResponse =>
            {
                var token        = JsonHelper.SafeDeserializeObject <AccountCreationResponse>(restResponse.Content);
                TokenStore.Token = new LoginToken(token.Token);
                _accountId       = token.AccountId;
                AsyncCompletedEventArgsExtensions.Raise(LoginCompleted, restResponse, null);
            });
        }
Exemple #3
0
 public void QueryRoomStatus(int roomId)
 {
     ExecuteRequestAsync(string.Format("roomstate/?roomid={0}", roomId), Method.GET,
                         restRespose =>
                         AsyncCompletedEventArgsExtensions.Raise(QueryRoomStatusCompleted, restRespose));
 }
Exemple #4
0
 public void LeaveRoomAsync(RoomInfo room)
 {
     ExecuteRequestAsync(
         string.Format("roominfo/?roomid={0}&userRoomCommand={1}", room.Id, (int)UserRoomCommand.Leave),
         Method.POST, restResponse => AsyncCompletedEventArgsExtensions.Raise(LeaveRoomCompleted, restResponse, room));
 }
Exemple #5
0
 public void GetMyRoomsAsync()
 {
     ExecuteRequestAsync("roominfo", Method.GET, restResponse => AsyncCompletedEventArgsExtensions.Raise(GetMyRoomsCompleted, restResponse));
 }
Exemple #6
0
 public void SearchAsync(string searchString)
 {
     ExecuteRequestAsync(string.Format("globalroominfo/?searchstring={0}", searchString),
                         Method.GET, restResponse => AsyncCompletedEventArgsExtensions.Raise(SearchCompleted, restResponse));
 }
Exemple #7
0
 public void QueryGetUserStateAsync()
 {
     ExecuteRequestAsync("userstate", Method.GET, restResponse => AsyncCompletedEventArgsExtensions.Raise(QueryUserStatusCompleted, restResponse));
 }