Exemplo n.º 1
0
 private void UpdateCommonResult(ReqMarkeingDataResponse response)
 {
     if (response.userResVo != null)
     {
         GameData.instance.UserInfo.UpdateResource(response.userResVo);
     }
     if (response.shipVO != null)
     {
         foreach (UserShip ship in response.shipVO)
         {
             GameData.instance.AddUserShip(ship);
         }
     }
     if (response.equipmentVo != null)
     {
         foreach (UserEquipment equipment in response.equipmentVo)
         {
             GameData.instance.AddUserEquipmenet(equipment);
         }
     }
     if (response.packageVo != null)
     {
         GameData.instance.UpdateUserItems(response.packageVo);
     }
 }
 public void ShowResult(ReqMarkeingDataResponse res)
 {
     if (res != null)
     {
         if ((res.shipVO != null) && (res.shipVO.Length > 0))
         {
             GameObjectUtil.InstantiateItemAsChildOf(this.getNewShipPrefab, base.gameObject).GetComponent<PVEGetNewShip>().UpdateShip(res.shipVO[0]);
         }
         else if ((res.equipmentVo != null) && (res.equipmentVo.Length > 0))
         {
             GameObjectUtil.InstantiateItemAsChildOf(this.getNewEquipPrefab, base.gameObject).GetComponent<GetNewEquipUI>().UpdateEquip(res.equipmentVo[0]);
         }
     }
 }
Exemplo n.º 3
0
 private void reqUpdateSuccess(BaseWWWRequest obj)
 {
     try
     {
         this.getAwardResponse = new JsonFx.Json.JsonReader().Read <ReqMarkeingDataResponse>(this.UTF8String);
         base.responseData     = this.getAwardResponse;
         if (this.getAwardResponse.eid != 0)
         {
             this.reqUpdateFail(obj);
         }
         else
         {
             GameData.instance.MarketingDatas = this.getAwardResponse.marketingData;
             this.OnUpdateStatusSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         //Form1.log(exception);
         this.reqUpdateFail(obj);
     }
 }
Exemplo n.º 4
0
 private void reqGetReachLevelAwardSuccess(BaseWWWRequest obj)
 {
     try
     {
         this.getAwardResponse = new JsonFx.Json.JsonReader().Read <ReqMarkeingDataResponse>(this.UTF8String);
         base.responseData     = this.getAwardResponse;
         if (this.getAwardResponse.eid != 0)
         {
             this.reqGetReachLevelAwardFail(obj);
         }
         else
         {
             this.UpdateCommonResult(this.getAwardResponse);
             GameData.instance.MarketingDatas.reachLevelAward = this.getAwardResponse.marketingData.reachLevelAward;
             this.OnGetReachLevelAwardSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         //Form1.log(exception);
         this.reqGetReachLevelAwardFail(obj);
     }
 }
 private void UpdateCommonResult(ReqMarkeingDataResponse response)
 {
     if (response.userResVo != null)
     {
         GameData.instance.UserInfo.UpdateResource(response.userResVo);
     }
     if (response.shipVO != null)
     {
         foreach (UserShip ship in response.shipVO)
         {
             GameData.instance.AddUserShip(ship);
         }
     }
     if (response.equipmentVo != null)
     {
         foreach (UserEquipment equipment in response.equipmentVo)
         {
             GameData.instance.AddUserEquipmenet(equipment);
         }
     }
     if (response.packageVo != null)
     {
         GameData.instance.UpdateUserItems(response.packageVo);
     }
 }
 private void reqUpdateSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.getAwardResponse = JsonReader.Deserialize<ReqMarkeingDataResponse>(base.UTF8String);
         }
         else
         {
             this.getAwardResponse = JsonReader.Deserialize<ReqMarkeingDataResponse>(base.www.text);
         }
         base.responseData = this.getAwardResponse;
         if (this.getAwardResponse.eid != 0)
         {
             this.reqUpdateFail(obj);
         }
         else
         {
             GameData.instance.MarketingDatas = this.getAwardResponse.marketingData;
             this.OnUpdateStatusSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         this.reqUpdateFail(obj);
     }
 }
 private void reqGetReachLevelAwardSuccess(BaseWWWRequest obj)
 {
     try
     {
         if (this.needZip)
         {
             this.getAwardResponse = JsonReader.Deserialize<ReqMarkeingDataResponse>(base.UTF8String);
         }
         else
         {
             this.getAwardResponse = JsonReader.Deserialize<ReqMarkeingDataResponse>(base.www.text);
         }
         base.responseData = this.getAwardResponse;
         if (this.getAwardResponse.eid != 0)
         {
             this.reqGetReachLevelAwardFail(obj);
         }
         else
         {
             this.UpdateCommonResult(this.getAwardResponse);
             GameData.instance.MarketingDatas.reachLevelAward = this.getAwardResponse.marketingData.reachLevelAward;
             this.OnGetReachLevelAwardSuccess(EventArgs.Empty);
         }
     }
     catch (Exception exception)
     {
         Debug.Log(exception);
         base.parseException = exception;
         this.reqGetReachLevelAwardFail(obj);
     }
 }