Beispiel #1
0
        public bool Deserialize(JSON_LoginInfoParam json)
        {
            if (json == null)
            {
                return(false);
            }
            this.iname = json.iname;
            this.path  = json.path;
            this.scene = (LoginInfoParam.SelectScene)json.scene;
            DateTime result1 = DateTime.MinValue;
            DateTime result2 = DateTime.MaxValue;

            if (!string.IsNullOrEmpty(json.begin_at))
            {
                DateTime.TryParse(json.begin_at, out result1);
            }
            if (!string.IsNullOrEmpty(json.end_at))
            {
                DateTime.TryParse(json.end_at, out result2);
            }
            this.begin_at         = TimeManager.FromDateTime(result1);
            this.end_at           = TimeManager.FromDateTime(result2);
            this.conditions       = (LoginInfoParam.DispConditions)json.conditions;
            this.conditions_value = json.conditions_value;
            return(true);
        }
Beispiel #2
0
        private void SortByEntryDate(List <FriendData> lists)
        {
            DateTime    created_at1      = DateTime.Now;
            DateTime    created_at2      = DateTime.Now;
            string      str_datetime_fmt = TimeManager.ISO_8601_FORMAT;
            CultureInfo ci = new CultureInfo("ja-JP");

            lists.Sort((Comparison <FriendData>)((fr1, fr2) =>
            {
                if (!DateTime.TryParseExact(fr1.CreatedAt, str_datetime_fmt, (IFormatProvider)ci, DateTimeStyles.None, out created_at1))
                {
                    Debug.LogWarningFormat("FriendList/SortByEntryDate ParseExact error! FUID={0}, PlayerName={1}, mCreatedAt={2}", new object[3]
                    {
                        (object)fr1.FUID,
                        (object)fr1.PlayerName,
                        (object)fr1.CreatedAt
                    });
                }
                if (!DateTime.TryParseExact(fr2.CreatedAt, str_datetime_fmt, (IFormatProvider)ci, DateTimeStyles.None, out created_at2))
                {
                    Debug.LogWarningFormat("FriendList/SortByEntryDate ParseExact error! FUID={0}, PlayerName={1}, mCreatedAt={2}", new object[3]
                    {
                        (object)fr2.FUID,
                        (object)fr2.PlayerName,
                        (object)fr2.CreatedAt
                    });
                }
                return((int)(TimeManager.FromDateTime(created_at2) - TimeManager.FromDateTime(created_at1)));
            }));
        }
        private void RefreshData()
        {
            GameManager instance          = MonoSingleton <GameManager> .Instance;
            long        vsFreeExpiredTime = instance.VSFreeExpiredTime;
            long        num = TimeManager.FromDateTime(TimeManager.ServerTime);
            int         vsStreakWinCntNow = instance.VS_StreakWinCnt_Now;
            int         vsGetCoinRate     = instance.GetVSGetCoinRate(-1L);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.OpenRoot, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CloseRoot, (UnityEngine.Object)null))
            {
                if (num < vsFreeExpiredTime)
                {
                    this.mEndTime = vsFreeExpiredTime;
                    this.OpenRoot.SetActive(true);
                    this.CloseRoot.SetActive(false);
                    this.CountDown();
                }
                else
                {
                    this.Close();
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StreakWin, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StreakWinTxt, (UnityEngine.Object)null))
            {
                this.StreakWin.SetActive(vsStreakWinCntNow > 1);
                this.StreakWinTxt.set_text(vsStreakWinCntNow.ToString());
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CoinRate, (UnityEngine.Object)null) || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CoinRateTxt, (UnityEngine.Object)null))
            {
                return;
            }
            this.CoinRate.SetActive(vsGetCoinRate > 1);
            this.CoinRateTxt.set_text(vsGetCoinRate.ToString());
        }
Beispiel #4
0
 public bool Deserialize(JSON_AppealEventMaster json)
 {
     if (json == null)
     {
         return(false);
     }
     this.appeal_id = json.fields.appeal_id;
     this.start_at  = TimeManager.FromDateTime(DateTime.Parse(json.fields.start_at));
     this.end_at    = TimeManager.FromDateTime(DateTime.Parse(json.fields.end_at));
     return(true);
 }
 public bool Deserialize(JSON_AppealEventShopMaster json)
 {
     if (json == null)
     {
         return(false);
     }
     this.appeal_id      = json.fields.appeal_id;
     this.start_at       = TimeManager.FromDateTime(DateTime.Parse(json.fields.start_at));
     this.end_at         = TimeManager.FromDateTime(DateTime.Parse(json.fields.end_at));
     this.priority       = json.fields.priority;
     this.position_chara = json.fields.position_chara;
     this.position_text  = json.fields.position_text;
     return(true);
 }
Beispiel #6
0
        private void RefreshTimer()
        {
            DateTime serverTime = TimeManager.ServerTime;
            DateTime dateTime   = TimeManager.FromUnixTime(this.mEndAt);
            TimeSpan timeSpan   = dateTime - serverTime;

            if (this.Disabled && timeSpan.TotalSeconds < 0.0 && this.mGachaEndAt >= Network.GetServerTime())
            {
                this.mEndAt = TimeManager.FromDateTime(dateTime.AddDays(1.0));
                dateTime    = TimeManager.FromUnixTime(this.mEndAt);
                timeSpan    = dateTime - serverTime;
                SRPG_Button component = (SRPG_Button)((Component)this).GetComponent <SRPG_Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    ((Selectable)component).set_interactable(true);
                    this.Disabled = false;
                }
            }
            string empty = string.Empty;
            string str;

            if (timeSpan.TotalDays >= 1.0)
            {
                str = LocalizedText.Get(this.FormatKey + "D", new object[1]
                {
                    (object)timeSpan.Days
                });
            }
            else if (timeSpan.TotalHours >= 1.0)
            {
                str = LocalizedText.Get(this.FormatKey + "H", new object[1]
                {
                    (object)timeSpan.Hours
                });
            }
            else
            {
                str = LocalizedText.Get(this.FormatKey + "M", new object[1]
                {
                    (object)Mathf.Max(timeSpan.Minutes, 0)
                });
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Value, (UnityEngine.Object)null) && this.Value.get_text() != str)
            {
                this.Value.set_text(str);
            }
            this.SetUpdateTimer(1f);
        }
 public override void OnSuccess(WWWResult www)
 {
     if (Network.IsError && Network.ErrCode == Network.EErrCode.VS_EnableTimeOutOfPriod)
     {
         MyPhoton instance = PunMonoSingleton <MyPhoton> .Instance;
         Network.RemoveAPI();
         ((Behaviour)this).set_enabled(false);
         if (instance.IsConnectedInRoom() && instance.GetRoomPlayerList().Count > 1)
         {
             Network.ResetError();
             this.ActivateOutputLinks(this.PIN_SUCCESS);
         }
         else
         {
             this.ActivateOutputLinks(this.PIN_FAILURE);
         }
     }
     else
     {
         GlobalVars.VersusFreeMatchTime = TimeManager.FromDateTime(TimeManager.ServerTime);
         this.Success();
     }
 }
Beispiel #8
0
        private void Start()
        {
            this.Chapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (this.Chapter == null)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) && this.ItemTemplate.get_activeInHierarchy())
                {
                    this.ItemTemplate.SetActive(false);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Message, (UnityEngine.Object)null))
                {
                    string    str       = (string)null;
                    ItemParam itemParam = (ItemParam)null;
                    int       num1      = 0;
                    if (this.Chapter.keys.Count > 0)
                    {
                        KeyItem key = this.Chapter.keys[0];
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                        num1 = key.num;
                    }
                    KeyQuestTypes keyQuestType     = this.Chapter.GetKeyQuestType();
                    bool          keyQuestTimeOver = GlobalVars.KeyQuestTimeOver;
                    switch (keyQuestType)
                    {
                    case KeyQuestTypes.Timer:
                        if (this.Chapter.keytime != 0L && itemParam != null)
                        {
                            DateTime dateTime1 = TimeManager.FromUnixTime(0L);
                            DateTime dateTime2;
                            if (this.Chapter.end == 0L)
                            {
                                dateTime2 = TimeManager.FromUnixTime(this.Chapter.keytime);
                            }
                            else
                            {
                                long num2 = Math.Min(this.Chapter.end - TimeManager.FromDateTime(TimeManager.ServerTime), this.Chapter.keytime);
                                dateTime2 = TimeManager.FromUnixTime(num2 >= 0L ? num2 : 0L);
                            }
                            TimeSpan timeSpan = dateTime2 - dateTime1;
                            if (timeSpan.TotalDays >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_D" : "sys.KEYQUEST_TIMEOVER_D", (object)itemParam.name, (object)num1, (object)timeSpan.Days);
                                break;
                            }
                            if (timeSpan.TotalHours >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_H" : "sys.KEYQUEST_TIMEOVER_H", (object)itemParam.name, (object)num1, (object)timeSpan.Hours);
                                break;
                            }
                            str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_M" : "sys.KEYQUEST_TIMEOVER_M", (object)itemParam.name, (object)num1, (object)Mathf.Max(timeSpan.Minutes, 0));
                            break;
                        }
                        break;

                    case KeyQuestTypes.Count:
                        str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_COUNT" : "sys.KEYQUEST_TIMEOVER_COUNT", (object)itemParam.name, (object)num1);
                        break;
                    }
                    this.Message.set_text(str);
                }
                this.Refresh();
            }
        }
Beispiel #9
0
        public override void OnActivate(int pinID)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            switch (pinID)
            {
            case 100:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Free;
                break;

            case 101:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Tower;
                break;

            case 102:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.Friend;
                break;

            case 103:
                if (GlobalVars.SelectedMultiPlayVersusType == this.type)
                {
                    if (this.type == VERSUS_TYPE.Tower)
                    {
                        if (instance.VersusTowerMatchBegin)
                        {
                            this.ActivateOutputLinks(201);
                            return;
                        }
                    }
                    else
                    {
                        this.ActivateOutputLinks(201);
                        return;
                    }
                }
                this.ActivateOutputLinks(202);
                return;

            case 104:
                if (instance.VersusTowerMatchBegin)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 105:
                if (instance.VersusTowerMatchReceipt)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 106:
                if (instance.Player.VersusSeazonGiftReceipt)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 107:
                VsTowerMatchEndParam towerMatchEndParam = instance.GetVsTowerMatchEndParam();
                if (towerMatchEndParam != null)
                {
                    VersusTowerParam versusTowerParam = instance.GetCurrentVersusTowerParam(towerMatchEndParam.floor);
                    if (versusTowerParam != null && (int)versusTowerParam.RankupNum == 0 && !towerMatchEndParam.rankup)
                    {
                        this.ActivateOutputLinks(201);
                        return;
                    }
                }
                this.ActivateOutputLinks(202);
                return;

            case 108:
                if (instance.AudienceMode)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 109:
                if (instance.IsVSCpuBattle)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 110:
                instance.IsVSCpuBattle = true;
                break;

            case 111:
                long matchExpiredTime = instance.RankMatchExpiredTime;
                long num = TimeManager.FromDateTime(TimeManager.ServerTime);
                instance.RankMatchBegin = num < matchExpiredTime;
                if (instance.RankMatchBegin)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 112:
                GlobalVars.SelectedMultiPlayVersusType = VERSUS_TYPE.RankMatch;
                break;

            case 113:
                if (instance.VSDraftType == VersusDraftType.Draft)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;

            case 114:
                if (instance.VSDraftType == VersusDraftType.Draft || instance.VSDraftType == VersusDraftType.DraftFriend)
                {
                    this.ActivateOutputLinks(201);
                    return;
                }
                this.ActivateOutputLinks(202);
                return;
            }
            this.ActivateOutputLinks(200);
        }
Beispiel #10
0
        public bool IsDisplayable(DateTime server_time, int player_level, bool is_beginner)
        {
            long num = TimeManager.FromDateTime(server_time);

            return(this.begin_at <= num && num < this.end_at && this.CheckConditions(player_level, is_beginner));
        }