private void OnSkipSuccess(object o, EventArgs e)
 {
     this.isRequestingServer = false;
     this.skipResponse = o as SkipWarResponse;
     this.hasSkipped = true;
     this.ShowSkipCost();
 }
Beispiel #2
0
    private void onReqSkipWarSuccess(BaseWWWRequest obj)
    {
        try
        {
            GameData instance = GameData.instance;
            this.skipWarResponse = new JsonReader().Read<SkipWarResponse>(base.UTF8String);

            base.responseData = this.skipWarResponse;
            if (this.skipWarResponse.eid != 0)
            {
                this.onReqSkipWarFail(obj);
            }
            else
            {
                instance.AddPassedNodeId(this.dealingNodeId);
                if (this.skipWarResponse.shipVO != null)
                {
                    foreach (UserShip ship in this.skipWarResponse.shipVO)
                    {
                        GameData.instance.UpdateUserShip(ship);
                    }
                }
                if ((this.skipWarResponse.newShipVO != null) && (this.skipWarResponse.newShipVO.Length > 0))
                {
                    CurrentWarParameters.newShipsGotFromWar = this.skipWarResponse.newShipVO;
                    foreach (UserShip ship2 in this.skipWarResponse.newShipVO)
                    {
                        GameData.instance.AddUserShip(ship2);
                    }
                }
                if (this.skipWarResponse.detailInfo != null)
                {
                    GameData.instance.UserInfo.UpdateDetailInfo(this.skipWarResponse.detailInfo);
                }
                if (this.skipWarResponse.campaignVo != null)
                {
                    if (this.skipWarResponse.campaignVo.canCampaignChallengeLevel != null)
                    {
                        GameData.instance.SetOpenedPVECampaignLevels(this.skipWarResponse.campaignVo.canCampaignChallengeLevel);
                    }
                    if (this.skipWarResponse.campaignVo.campaignChallenge != null)
                    {
                        GameData.instance.SetCampaignChapterTimesInfo(this.skipWarResponse.campaignVo.campaignChallenge);
                    }
                    if (this.skipWarResponse.campaignVo.passInfo != null)
                    {
                        GameData.instance.TotalCampainInfo = this.skipWarResponse.campaignVo.passInfo;
                    }
                }
                if (this.skipWarResponse.warResult != null)
                {
                    this.CheckUserNewExpInfo(this.skipWarResponse.warResult.userLevelVo);
                }
                this.HandleNewPveData(this.skipWarResponse.newPveData);
                this.OnGetSkipWarResultSuccess(EventArgs.Empty);
            }
        }
        catch (Exception exception)
        {
            z.log(exception.Message);
            this.onReqSkipWarFail(obj);
        }
    }
Beispiel #3
0
    private void onReqSkipWarSuccess(BaseWWWRequest obj)
    {
        try
        {
            GameData instance = GameData.instance;
            this.skipWarResponse = new JsonReader().Read <SkipWarResponse>(base.UTF8String);

            base.responseData = this.skipWarResponse;
            if (this.skipWarResponse.eid != 0)
            {
                this.onReqSkipWarFail(obj);
            }
            else
            {
                instance.AddPassedNodeId(this.dealingNodeId);
                if (this.skipWarResponse.shipVO != null)
                {
                    foreach (UserShip ship in this.skipWarResponse.shipVO)
                    {
                        GameData.instance.UpdateUserShip(ship);
                    }
                }
                if ((this.skipWarResponse.newShipVO != null) && (this.skipWarResponse.newShipVO.Length > 0))
                {
                    CurrentWarParameters.newShipsGotFromWar = this.skipWarResponse.newShipVO;
                    foreach (UserShip ship2 in this.skipWarResponse.newShipVO)
                    {
                        GameData.instance.AddUserShip(ship2);
                    }
                }
                if (this.skipWarResponse.detailInfo != null)
                {
                    GameData.instance.UserInfo.UpdateDetailInfo(this.skipWarResponse.detailInfo);
                }
                if (this.skipWarResponse.campaignVo != null)
                {
                    if (this.skipWarResponse.campaignVo.canCampaignChallengeLevel != null)
                    {
                        GameData.instance.SetOpenedPVECampaignLevels(this.skipWarResponse.campaignVo.canCampaignChallengeLevel);
                    }
                    if (this.skipWarResponse.campaignVo.campaignChallenge != null)
                    {
                        GameData.instance.SetCampaignChapterTimesInfo(this.skipWarResponse.campaignVo.campaignChallenge);
                    }
                    if (this.skipWarResponse.campaignVo.passInfo != null)
                    {
                        GameData.instance.TotalCampainInfo = this.skipWarResponse.campaignVo.passInfo;
                    }
                }
                if (this.skipWarResponse.warResult != null)
                {
                    this.CheckUserNewExpInfo(this.skipWarResponse.warResult.userLevelVo);
                }
                this.HandleNewPveData(this.skipWarResponse.newPveData);
                this.OnGetSkipWarResultSuccess(EventArgs.Empty);
            }
        }
        catch (Exception exception)
        {
            z.log(exception.Message);
            this.onReqSkipWarFail(obj);
        }
    }