當前位置: 首頁>>代碼示例>>C#>>正文


C# BaseWWWRequest類代碼示例

本文整理匯總了C#中BaseWWWRequest的典型用法代碼示例。如果您正苦於以下問題:C# BaseWWWRequest類的具體用法?C# BaseWWWRequest怎麽用?C# BaseWWWRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseWWWRequest類屬於命名空間,在下文中一共展示了BaseWWWRequest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: onReqSkillSuccess

 private void onReqSkillSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.skillResponse = JsonReader.Deserialize<SkillShipData>(base.UTF8String);
         }
         else
         {
             this.skillResponse = JsonReader.Deserialize<SkillShipData>(base.www.text);
         }
         base.responseData = this.skillResponse;
         if (this.skillResponse.eid != 0)
         {
             this.onReqSkillFail(obj);
         }
         else
         {
             if (this.skillResponse.shipVO != null)
             {
                 GameData.instance.UpdateUserShip(this.skillResponse.shipVO);
             }
             this.OnSkillSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onReqSkillFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:33,代碼來源:ReqSkill.cs

示例2: onInitShipSuccess

 private void onInitShipSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.initResponse = JsonReader.Deserialize<BasicResponse>(base.UTF8String);
         }
         else
         {
             this.initResponse = JsonReader.Deserialize<BasicResponse>(base.www.text);
         }
         if (this.initResponse.eid != 0)
         {
             this.onInitFail(obj);
         }
         else
         {
             ServerRequestManager.instance.OnChooseInitShipSuccess();
             Debug.Log("onInitShipSuccess Success: " + base.www.text);
         }
     }
     catch (Exception)
     {
         this.onInitFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:27,代碼來源:ReqLogin.cs

示例3: onSuccess

 private void onSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.loginVO = JsonReader.Deserialize<LoginVO>(base.UTF8String);
         }
         else
         {
             this.loginVO = JsonReader.Deserialize<LoginVO>(base.www.text);
         }
         if (this.loginVO.eid != 0)
         {
             this.onFail(obj);
         }
         else
         {
             GameData.instance.LoginInfo = this.loginVO;
             ServerRequestManager.instance.OnLoginSuccess();
         }
     }
     catch (Exception)
     {
         this.onFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:27,代碼來源:ReqLogin.cs

示例4: onReqChangeSuccess

 private void onReqChangeSuccess(BaseWWWRequest obj)
 {
     try
     {
         ChangeEquipData data = new JsonFx.Json.JsonReader().Read<ChangeEquipData>(this.UTF8String);
         base.responseData = data;
         if (data.eid != 0)
         {
             this.onReqChangeFail(obj);
         }
         else
         {
             if (data.shipVO != null)
             {
                 GameData.instance.UpdateUserShip(data.shipVO);
             }
             if (data.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(data.detailInfo);
             }
             this.UpdateEquip();
             this.OnChangeEquipSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         z.log(exception.Message);
         this.onReqChangeFail(obj);
     }
 }
開發者ID:lavender1213,項目名稱:ShipGirlBot,代碼行數:30,代碼來源:ReqEquipment.cs

示例5: onReqChangeSuccess

 private void onReqChangeSuccess(BaseWWWRequest obj)
 {
     try
     {
         DestroyShipData data = new JsonFx.Json.JsonReader().Read<DestroyShipData>(this.UTF8String);
         base.responseData = data;
         if (data.eid != 0)
         {
             this.onReqChangeFail(obj);
         }
         else
         {
             if (data.userVo != null)
             {
                 GameData.instance.UserInfo.UpdateResource(data.userVo);
             }
             if (data.equipmentVo != null)
             {
                 GameData.instance.SetUserEquipments(data.equipmentVo);
             }
             if (data.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(data.detailInfo);
             }
             this.UpdateShips();
             this.OnDestroySuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         z.log(exception.Message);
         this.onReqChangeFail(obj);
     }
 }
開發者ID:lavender1213,項目名稱:ShipGirlBot,代碼行數:34,代碼來源:ReqDestroyShip.cs

示例6: onReqSkillSuccess

 private void onReqSkillSuccess(BaseWWWRequest obj)
 {
     try
     {
         this.skillResponse = new JsonReader().Read<SkillShipData>(base.UTF8String);
         base.responseData = this.skillResponse;
         if (this.skillResponse.eid != 0)
         {
             this.onReqSkillFail(obj);
         }
         else
         {
             if (this.skillResponse.shipVO != null)
             {
                 GameData.instance.UpdateUserShip(this.skillResponse.shipVO);
             }
             this.OnSkillSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         z.log(exception.Message);
         this.onReqSkillFail(obj);
     }
 }
開發者ID:lavender1213,項目名稱:ShipGirlBot,代碼行數:25,代碼來源:ReqSkill.cs

示例7: onReqToggleLockSuccess

 private void onReqToggleLockSuccess(BaseWWWRequest obj)
 {
     try
     {
         ToggleUserShipLockResponse response;
         if (this.needZip)
         {
             response = JsonReader.Deserialize<ToggleUserShipLockResponse>(base.UTF8String);
         }
         else
         {
             response = JsonReader.Deserialize<ToggleUserShipLockResponse>(base.www.text);
         }
         base.responseData = response;
         if (response.eid != 0)
         {
             this.onReqToggleLockFail(obj);
         }
         else
         {
             this.requestingShip.isLocked = response.isLocked;
             this.OnToggleLockSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onReqToggleLockFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:31,代碼來源:FleetShipChangeRequest.cs

示例8: onReqGetListSuccess

 private void onReqGetListSuccess(BaseWWWRequest obj)
 {
     try
     {
         LeaderBoardListData data;
         if (this.needZip)
         {
             data = JsonReader.Deserialize<LeaderBoardListData>(base.UTF8String);
         }
         else
         {
             data = JsonReader.Deserialize<LeaderBoardListData>(base.www.text);
         }
         base.responseData = data;
         if (data.eid != 0)
         {
             this.onReqGetListFail(obj);
         }
         else
         {
             GameData.instance.SetLeaderBoardData(data);
             this.OnGetListSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onReqGetListFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:31,代碼來源:ReqLeaderBoard.cs

示例9: onReqStrenSuccess

 private void onReqStrenSuccess(BaseWWWRequest obj)
 {
     try
     {
         StrengthenData data = new JsonReader().Read<StrengthenData>(base.UTF8String);
         base.responseData = data;
         if (data.eid != 0)
         {
             this.onReqStrenFail(obj);
         }
         else
         {
             if (data.shipVO != null)
             {
                 GameData.instance.UpdateUserShip(data.shipVO);
             }
             this.DeleteMaterials();
             if (data.detailInfo != null)
             {
                 GameData.instance.UserInfo.UpdateDetailInfo(data.detailInfo);
             }
             if (data.equipmentVo != null)
             {
                 GameData.instance.SetUserEquipments(data.equipmentVo);
             }
             this.OnStrengthenSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         z.log(exception.Message);
         this.onReqStrenFail(obj);
     }
 }
開發者ID:lavender1213,項目名稱:ShipGirlBot,代碼行數:34,代碼來源:ReqStrengthen.cs

示例10: onReqChangeSuccess

 private void onReqChangeSuccess(BaseWWWRequest obj)
 {
     try
     {
         GetCardResponse response;
         if (this.needZip)
         {
             response = JsonReader.Deserialize<GetCardResponse>(base.UTF8String);
         }
         else
         {
             response = JsonReader.Deserialize<GetCardResponse>(base.www.text);
         }
         base.responseData = response;
         if (response.eid != 0)
         {
             this.onReqChangeFail(obj);
         }
         else
         {
             GameData.instance.SetUnlockedCards(response.unlockShip);
             this.OnGetCardsSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onReqChangeFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:31,代碼來源:ReqUnlockedCard.cs

示例11: onInitFail

 private void onInitFail(BaseWWWRequest obj)
 {
     if (this.initResponse != null)
     {
         ServerRequestManager.instance.OnChooseInitShipFail(this.initResponse.eid);
     }
     else
     {
         ServerRequestManager.instance.OnChooseInitShipFail(0);
     }
     Debug.Log("Login Fail: " + base.www.error + "\n " + base.www.text);
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:12,代碼來源:ReqLogin.cs

示例12: onFail

 private void onFail(BaseWWWRequest obj)
 {
     if (this.loginVO != null)
     {
         ServerRequestManager.instance.OnLoginFail(this.loginVO.eid);
     }
     else
     {
         ServerRequestManager.instance.OnLoginFail(0);
     }
     Debug.Log("Login Fail: " + base.www.error + "\n " + base.www.text);
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:12,代碼來源:ReqLogin.cs

示例13: onFail

 private void onFail(BaseWWWRequest obj)
 {
     if (this.loginVO != null)
     {
         ServerRequestManager.instance.OnLoginFail(this.loginVO.eid);
     }
     else
     {
         ServerRequestManager.instance.OnLoginFail(0);
     }
     z.log("[登陸失敗] " + base.www.error + "\r\n " + this.UTF8String);
 }
開發者ID:lavender1213,項目名稱:ShipGirlBot,代碼行數:12,代碼來源:ReqLogin.cs

示例14: onSuccess

    private void onSuccess(BaseWWWRequest obj)
    {
        try
        {
            AllConfigs configs;
            if (this.needZip)
            {
                configs = new JsonFx.Json.JsonReader().Read<AllConfigs>(base.UTF8String);
            }
            else
            {
                configs = new JsonFx.Json.JsonReader().Read<AllConfigs>(this.UTF8String);
            }
            if (configs.eid != 0)
            {
                this.onFail(obj);
            }
            else
            {
                z.log("setShips");
                AllShipConfigs.instance.setShips(configs.shipCard);
                z.log("shipCard");
                GameConfigs.instance.PrepareEquipmentConfigs(configs.shipEquipment);
                z.log("PrepareEquipmentConfigs");
                GameConfigs.instance.PreparePVEExploreLevels(configs.pveExplore);
                z.log("PreparePVEExploreLevels");
                GameConfigs.instance.SetShopItems(configs.shipShop);
                GameConfigs.instance.SetShipEvoItems(configs.shipItem);
                GameConfigs.instance.SetSkillConfigs(configs.shipSkill);
                z.log("SetSkillConfigs");
                GameConfigs.instance.SetBuffConfigs(configs.shipSkillBuff);
                GameConfigs.instance.GlobalConfig = configs.globalConfig;
                GameConfigs.instance.marketingConfigs = configs.marketingConfigs;
                z.log("marketingConfigs");
                PVEConfigs.instance.SetCampaignChapters(configs.shipCampaign);
                PVEConfigs.instance.SetCampaignLevels(configs.shipCampaignLevel);
                GameConfigs.instance.errCode = configs.errorCode;

                //if (this.testShipUpdate && (this.shipUpdateconfigs != null))
                //{
                //    UpdateConfigs configs2 = JsonReader.Deserialize<UpdateConfigs>(this.shipUpdateconfigs.text);
                //    UpdateManager.Instance.SetShips(configs2.ships);
                //}

                ServerRequestManager.instance.OnLoadConfigsComplete();
            }
        }
        catch (Exception e)
        {
            z.log(e.Message+ "  " + e.StackTrace);
            this.onFail(obj);
        }
    }
開發者ID:lavender1213,項目名稱:ShipGirlBot,代碼行數:53,代碼來源:LoadConfigs.cs

示例15: onReqModifySuccess

 private void onReqModifySuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.modifyResponse = JsonReader.Deserialize<ModifyShipData>(base.UTF8String);
         }
         else
         {
             this.modifyResponse = JsonReader.Deserialize<ModifyShipData>(base.www.text);
         }
         base.responseData = this.modifyResponse;
         if (this.modifyResponse.eid != 0)
         {
             this.onReqModifyFail(obj);
         }
         else
         {
             this.UpdateShips();
             if (this.modifyResponse.userResVo != null)
             {
                 GameData.instance.UserInfo.UpdateResource(this.modifyResponse.userResVo);
             }
             if (this.modifyResponse.shipVO != null)
             {
                 foreach (UserShip ship in this.modifyResponse.shipVO)
                 {
                     GameData.instance.AddUserShip(ship);
                 }
             }
             if (this.modifyResponse.equipmentVo != null)
             {
                 foreach (UserEquipment equipment in this.modifyResponse.equipmentVo)
                 {
                     GameData.instance.AddUserEquipmenet(equipment);
                 }
             }
             if (this.modifyResponse.packageVo != null)
             {
                 GameData.instance.UpdateUserItems(this.modifyResponse.packageVo);
             }
             this.OnModifySuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.onReqModifyFail(obj);
     }
 }
開發者ID:Lessica,項目名稱:Something-of-SHIPWAR-GAMES,代碼行數:52,代碼來源:ReqModify.cs


注:本文中的BaseWWWRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。