public void RequestExitRoom()
 {
     if (_exitRoomInterceptor.AllowRequest())
     {
         JObject o = new JObject
         {
             { "Command", NotifyConsts.RoomNotification.RequestExitRoom },
             {
                 "Paras", new JObject
                 {
                     { "UserId", _localPlayer.UserID },
                     { "Token", _localPlayer.Token }
                 }
             }
         };
         _ = NetworkService.Instance.SendCommandAsync(o.ToString(Formatting.None));
         _ = _exitRoomInterceptor.BeginWaitResponseAsync();
     }
 }
Beispiel #2
0
 public void RequestLogin(string username, string password)
 {
     if (_loginInterceptor.AllowRequest())
     {
         JObject o = new JObject
         {
             { "Command", NotifyConsts.LoginNotification.RequestLogin },
             {
                 "Paras", new JObject
                 {
                     { "UserName", username },
                     { "Password", password }
                 }
             }
         };
         _ = NetworkService.Instance.SendCommandAsync(o.ToString(Formatting.None));
         _ = _loginInterceptor.BeginWaitResponseAsync();
     }
 }
 public void RequestChangePrepareState(bool prepareState)
 {
     if (_changePrepareStateInterceptor.AllowRequest())
     {
         JObject o = new JObject
         {
             { "Command", NotifyConsts.RoomNotification.RequestChangePrepareState },
             {
                 "Paras", new JObject
                 {
                     { "UserId", _localPlayer.UserID },
                     { "Token", _localPlayer.Token },
                     { "PrepareState", prepareState }
                 }
             }
         };
         _ = NetworkService.Instance.SendCommandAsync(o.ToString(Formatting.None));
         _ = _changePrepareStateInterceptor.BeginWaitResponseAsync();
     }
 }
 public void RequestPurchaseItem(string itemId)
 {
     if (_purchaseInterceptor.AllowRequest())
     {
         JObject o = new JObject
         {
             { "Command", NotifyConsts.StoreNotification.RequestPurchaseItem },
             {
                 "Paras", new JObject
                 {
                     { "UserId", _localPlayer.UserID },
                     { "Token", _localPlayer.Token },
                     { "VehicleId", itemId }
                 }
             }
         };
         _ = NetworkService.Instance.SendCommandAsync(o.ToString(Formatting.None));
         _ = _purchaseInterceptor.BeginWaitResponseAsync();
     }
 }
 public void RequestChangePassword(string oldPassword, string newPassword)
 {
     if (_changePwdInterceptor.AllowRequest())
     {
         JObject o = new JObject
         {
             { "Command", NotifyConsts.MainMenuNotification.RequestChangePassword },
             {
                 "Paras", new JObject
                 {
                     { "UserId", _localPlayer.UserID },
                     { "Token", _localPlayer.Token },
                     { "OldPassword", oldPassword },
                     { "NewPassword", newPassword }
                 }
             }
         };
         _ = NetworkService.Instance.SendCommandAsync(o.ToString(Formatting.None));
         _ = _changePwdInterceptor.BeginWaitResponseAsync();
     }
 }
 public void RequestCreateRoom(string roomName, string roomMode, string roomMap)
 {
     if (_createRoomInterceptor.AllowRequest())
     {
         JObject o = new JObject
         {
             { "Command", NotifyConsts.LobbyNotification.RequestCreateRoom },
             {
                 "Paras", new JObject
                 {
                     { "UserId", _localPlayer.UserID },
                     { "Token", _localPlayer.Token },
                     { "RoomName", roomName },
                     { "RoomMode", roomMode },
                     { "RoomMap", roomMap },
                 }
             }
         };
         _ = NetworkService.Instance.SendCommandAsync(o.ToString(Formatting.None));
         _ = _createRoomInterceptor.BeginWaitResponseAsync();
     }
 }