Beispiel #1
0
 public override void OnSuccess(WWWResult www)
 {
     if (this.Error())
     {
         return;
     }
     FlowNode_TowerStartQuest.Json_TowerStartQuest jsonTowerStartQuest = (FlowNode_TowerStartQuest.Json_TowerStartQuest)null;
     WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume>)null;
     if (this.mResume)
     {
         jsonBodyResponse = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume> >(www.text);
         if (jsonBodyResponse.body.pdeck != null)
         {
             MonoSingleton <GameManager> .Instance.TowerResuponse.Deserialize(jsonBodyResponse.body.pdeck);
         }
         if (jsonBodyResponse.body.edeck != null)
         {
             MonoSingleton <GameManager> .Instance.TowerResuponse.Deserialize(jsonBodyResponse.body.edeck);
         }
         jsonTowerStartQuest         = new FlowNode_TowerStartQuest.Json_TowerStartQuest();
         jsonTowerStartQuest.btlinfo = jsonBodyResponse.body.btlinfo;
         jsonTowerStartQuest.btlid   = jsonBodyResponse.body.btlid;
         MonoSingleton <GameManager> .Instance.TowerResuponse.round = jsonBodyResponse.body.round;
     }
     WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerStartQuest> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerStartQuest> >(www.text);
     if (jsonObject.body == null)
     {
         this.OnRetry();
     }
     else
     {
         if (jsonTowerStartQuest == null)
         {
             jsonTowerStartQuest = jsonObject.body;
         }
         if (this.mResume && jsonBodyResponse == null)
         {
             jsonTowerStartQuest.btlinfo = jsonBodyResponse.body.btlinfo;
         }
         Network.RemoveAPI();
         BattleCore.Json_Battle json = new BattleCore.Json_Battle();
         json.btlid   = jsonTowerStartQuest.btlid;
         json.btlinfo = (BattleCore.Json_BtlInfo)jsonTowerStartQuest.btlinfo;
         if (json.btlinfo != null)
         {
             json.btlinfo.qid = jsonTowerStartQuest.btlinfo.floor_iname;
         }
         this.StartCoroutine(this.StartScene(json));
     }
 }
Beispiel #2
0
        public override void OnSuccess(WWWResult www)
        {
            if (this.Error())
            {
                return;
            }
            FlowNode_TowerStartQuest.Json_TowerStartQuest jsonTowerStartQuest = (FlowNode_TowerStartQuest.Json_TowerStartQuest)null;
            WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume> jsonBodyResponse = (WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume>)null;
            if (this.mResume)
            {
                jsonBodyResponse = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerResume> >(www.text);
                if (jsonBodyResponse.body.pdeck != null)
                {
                    MonoSingleton <GameManager> .Instance.TowerResuponse.Deserialize(jsonBodyResponse.body.pdeck);
                }
                if (jsonBodyResponse.body.edeck != null)
                {
                    MonoSingleton <GameManager> .Instance.TowerResuponse.Deserialize(jsonBodyResponse.body.edeck);
                }
                jsonTowerStartQuest         = new FlowNode_TowerStartQuest.Json_TowerStartQuest();
                jsonTowerStartQuest.btlinfo = jsonBodyResponse.body.btlinfo;
                jsonTowerStartQuest.btlid   = jsonBodyResponse.body.btlid;
                MonoSingleton <GameManager> .Instance.TowerResuponse.round = jsonBodyResponse.body.round;
            }
            WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerStartQuest> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_TowerStartQuest.Json_TowerStartQuest> >(www.text);
            if (jsonObject.body == null)
            {
                this.OnRetry();
            }
            else
            {
                if (jsonTowerStartQuest == null)
                {
                    jsonTowerStartQuest = jsonObject.body;
                }
                if (this.mResume && jsonBodyResponse == null)
                {
                    jsonTowerStartQuest.btlinfo = jsonBodyResponse.body.btlinfo;
                }
                Network.RemoveAPI();
                BattleCore.Json_Battle json = new BattleCore.Json_Battle();
                json.btlid   = jsonTowerStartQuest.btlid;
                json.btlinfo = (BattleCore.Json_BtlInfo)jsonTowerStartQuest.btlinfo;
                if (json.btlinfo != null)
                {
                    json.btlinfo.qid = jsonTowerStartQuest.btlinfo.floor_iname;
                }
                QuestParam quest = MonoSingleton <GameManager> .Instance.FindQuest(json.btlinfo.qid);

                if (quest != null)
                {
                    if (jsonObject.body.missions != null)
                    {
                        for (int index = 0; index < jsonObject.body.missions.Length; ++index)
                        {
                            bool isClear = jsonObject.body.missions[index] == 1;
                            quest.SetMissionFlag(index, isClear);
                        }
                    }
                    if (jsonObject.body.missions_val != null)
                    {
                        for (int index = 0; index < jsonObject.body.missions_val.Length; ++index)
                        {
                            int num = jsonObject.body.missions_val[index];
                            quest.SetMissionValue(index, num);
                        }
                    }
                }
                this.StartCoroutine(this.StartScene(json));
            }
        }