Пример #1
0
        public override IEnumerator OnAddToStack()
        {
            yield return(base.OnAddToStack());

            if (!hasRequest)
            {
                EB.Sparx.Request request = LTHotfixApi.GetInstance().Post("/lostchallengecampaign/getTeamViews");
                request.AddData("level", LTInstanceMapModel.Instance.CurLevelNum);
                LTHotfixApi.GetInstance().BlockService(request, delegate(Hashtable data)
                {
                    if (data != null)
                    {
                        hasRequest = true;
                        var array  = Hotfix_LT.EBCore.Dot.Array("teamView", data, null);
                        TheFast.OnFill(null, EB.Localizer.GetString("ID_PASS_INFO_TIME"));
                        TheNear.OnFill(null, EB.Localizer.GetString("ID_PASS_INFO_TIME2"));
                        if (array != null)
                        {
                            for (int i = 0; i < array.Count; ++i)
                            {
                                Hashtable hash = array[i] as Hashtable;
                                string type    = EB.Dot.String("type", hash, null);
                                if (type.Equals(TheFastStr))
                                {
                                    int time        = EB.Dot.Integer("fastTime", hash, 0);
                                    string timeTemp = string.Format(EB.Localizer.GetString("ID_PASS_INFO_TIME3"), time / 60 / 60, time / 60 % 60, time % 60);
                                    string timeStr  = string.Format("{0}{1}", EB.Localizer.GetString("ID_PASS_INFO_TIME"), timeTemp);
                                    TheFast.OnFill(EB.Dot.Object("teamView", hash, null), timeStr);
                                }
                                else if (type.Equals(TheNearStr))
                                {
                                    int time           = EB.Dot.Integer("ts", hash, 0);
                                    DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
                                    DateTime dt        = startTime.AddSeconds(time);
                                    string timeTemp    = string.Format(EB.Localizer.GetString("ID_PASS_INFO_TIME4"), dt.Year, dt.Month, dt.Day);
                                    string timeStr     = string.Format("{0}{1}", EB.Localizer.GetString("ID_PASS_INFO_TIME2"), timeTemp);
                                    TheNear.OnFill(EB.Dot.Object("teamView", hash, null), timeStr);
                                }
                            }
                        }
                    }
                });
            }
        }
Пример #2
0
        private void UpdateTheFast()
        {
            Item.OnFill(null, null);
            int time = LTUltimateTrialDataManager.Instance.GetCurCompeteRealmInfo();

            if (time > 0)
            {
                Hashtable data = LTUltimateTrialDataManager.Instance.GetCurCompeteRealmInfoTeam();
                int       hour = time / 60;
                string    timeStr;
                if (hour > 99)
                {
                    timeStr = "99:60";
                }
                else
                {
                    timeStr = string.Format("{0}:{1}", hour.ToString("00"), (time % 60).ToString("00"));
                }
                Item.OnFill(data, timeStr);
            }
        }