public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError)
     {
         Network.EErrCode errCode = Network.ErrCode;
         this.OnRetry();
     }
     else
     {
         WebAPI.JSON_BodyResponse <FlowNode_ReqBingoProgress.JSON_BingoResponse> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqBingoProgress.JSON_BingoResponse> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         if (jsonObject.body == null)
         {
             this.OnRetry();
         }
         else if (jsonObject.body.bingoprogs == null)
         {
             Network.RemoveAPI();
             this.Success();
         }
         else
         {
             GameManager instance = MonoSingleton <GameManager> .Instance;
             for (int index1 = 0; index1 < jsonObject.body.bingoprogs.Length; ++index1)
             {
                 JSON_TrophyProgress bingoprog = jsonObject.body.bingoprogs[index1];
                 if (bingoprog != null)
                 {
                     if (instance.MasterParam.GetTrophy(bingoprog.iname) == null)
                     {
                         DebugUtility.LogError("存在しないミッション:" + bingoprog.iname);
                     }
                     else
                     {
                         TrophyState trophyCounter = instance.Player.GetTrophyCounter(instance.MasterParam.GetTrophy(bingoprog.iname), false);
                         for (int index2 = 0; index2 < bingoprog.pts.Length && index2 < trophyCounter.Count.Length; ++index2)
                         {
                             trophyCounter.Count[index2] = bingoprog.pts[index2];
                         }
                         trophyCounter.StartYMD = bingoprog.ymd;
                         trophyCounter.IsEnded  = bingoprog.rewarded_at != 0;
                     }
                 }
             }
             Network.RemoveAPI();
             this.Success();
         }
     }
 }
Esempio n. 2
0
        private void reflectTrophyProgs(JSON_TrophyProgress[] trophy_progs)
        {
            if (trophy_progs == null)
            {
                return;
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index1 = 0; index1 < trophy_progs.Length; ++index1)
            {
                JSON_TrophyProgress trophyProg = trophy_progs[index1];
                if (trophyProg != null)
                {
                    if (instance.MasterParam.GetTrophy(trophyProg.iname) == null)
                    {
                        DebugUtility.LogWarning("存在しないミッション:" + trophyProg.iname);
                    }
                    else
                    {
                        TrophyState trophyCounter = instance.Player.GetTrophyCounter(instance.MasterParam.GetTrophy(trophyProg.iname));
                        for (int index2 = 0; index2 < trophyProg.pts.Length && index2 < trophyCounter.Count.Length; ++index2)
                        {
                            trophyCounter.Count[index2] = trophyProg.pts[index2];
                        }
                        trophyCounter.StartYMD = trophyProg.ymd;
                        trophyCounter.IsEnded  = trophyProg.rewarded_at != 0;
                        if (trophyProg.rewarded_at != 0)
                        {
                            try
                            {
                                trophyCounter.RewardedAt = trophyProg.rewarded_at.FromYMD();
                            }
                            catch
                            {
                                trophyCounter.RewardedAt = DateTime.MinValue;
                            }
                        }
                        else
                        {
                            trophyCounter.RewardedAt = DateTime.MinValue;
                        }
                    }
                }
            }
        }
        private void reflectTrophyProgs(JSON_TrophyProgress[] trophy_progs)
        {
            if (trophy_progs == null)
            {
                return;
            }
            Dictionary <int, List <JSON_TrophyProgress> > progs = new Dictionary <int, List <JSON_TrophyProgress> >();
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < trophy_progs.Length; ++index)
            {
                JSON_TrophyProgress trophyProg = trophy_progs[index];
                if (trophyProg != null)
                {
                    TrophyParam trophy = instance.MasterParam.GetTrophy(trophyProg.iname);
                    if (trophy == null)
                    {
                        DebugUtility.LogWarning("存在しないミッション:" + trophyProg.iname);
                    }
                    else
                    {
                        if (trophy.Objectives[0].type.IsExtraClear())
                        {
                            int type = (int)trophy.Objectives[0].type;
                            if (!progs.ContainsKey(type))
                            {
                                progs[type] = new List <JSON_TrophyProgress>();
                            }
                            progs[type].Add(trophy_progs[index]);
                        }
                        instance.Player.RegistTrophyStateDictByProg(instance.MasterParam.GetTrophy(trophyProg.iname), trophyProg);
                    }
                }
            }
            instance.Player.CreateInheritingExtraTrophy(progs);
        }