| | |
| | |
|
| | | public FairyLeagueWeekTime currentWeekTime
|
| | | {
|
| | | get { return fairyLeagueWeekTime; }
|
| | | get
|
| | | {
|
| | | var openServerTime = TimeUtility.openServerTime;
|
| | | var openServerWeekDay = openServerTime.DayOfWeek == DayOfWeek.Sunday ? 7 : (int)openServerTime.DayOfWeek;
|
| | | if (specificlLeagueTimes.ContainsKey(openServerWeekDay))
|
| | | {
|
| | | var dict = specificlLeagueTimes[openServerWeekDay];
|
| | | var weekCount = TimeUtility.OpenWeekCnt;
|
| | | if (dict.ContainsKey(weekCount))
|
| | | {
|
| | | return dict[weekCount];
|
| | | }
|
| | | }
|
| | | if (TimeUtility.OpenWeekCnt <= 1)
|
| | | {
|
| | | return null;
|
| | | }
|
| | | return fairyLeagueWeekTime;
|
| | | }
|
| | | }
|
| | |
|
| | | public FairyLeagueWeekTime nextWeekTime
|
| | | {
|
| | | get { return fairyLeagueWeekTime; }
|
| | | get
|
| | | {
|
| | | var openServerTime = TimeUtility.openServerTime;
|
| | | var openServerWeekDay = openServerTime.DayOfWeek == DayOfWeek.Sunday ? 7 : (int)openServerTime.DayOfWeek;
|
| | | if (specificlLeagueTimes.ContainsKey(openServerWeekDay))
|
| | | {
|
| | | var dict = specificlLeagueTimes[openServerWeekDay];
|
| | | var weekCount = TimeUtility.OpenWeekCnt + 1;
|
| | | if (dict.ContainsKey(weekCount))
|
| | | {
|
| | | return dict[weekCount];
|
| | | }
|
| | | }
|
| | | return fairyLeagueWeekTime;
|
| | | }
|
| | | }
|
| | |
|
| | | FairyLeagueStage cacheLeagueStage = FairyLeagueStage.Prepare;
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | if (currentWeekTime == null)
|
| | | {
|
| | | return FairyLeagueStage.Prepare;
|
| | | }
|
| | | return currentWeekTime.fairyLeagueStage;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | if (currentWeekTime == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | return currentWeekTime.currentSession;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | if (currentWeekTime == null)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | return currentWeekTime.currentRing;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | if (currentWeekTime == null)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return currentWeekTime.IsNextWeek;
|
| | | }
|
| | | }
|
| | |
| | | private Dictionary<int, float> crystalRateDict = new Dictionary<int, float>();
|
| | | readonly List<int> fairyLeagueStateValues = new List<int>() { 11, 12, 13, 21, 22, 23 };
|
| | | FairyLeagueWeekTime fairyLeagueWeekTime = new FairyLeagueWeekTime();
|
| | | Dictionary<int, Dictionary<int, FairyLeagueWeekTime>> specificlLeagueTimes = new Dictionary<int, Dictionary<int, FairyLeagueWeekTime>>();
|
| | | private void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig cfg = Config.Instance.Get<FuncConfigConfig>("FamilyMatchGuide");
|
| | |
| | | var configs = Config.Instance.GetAllValues<DungeonStateTimeConfig>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | if (fairyLeagueStateValues.Contains(configs[i].StateValue))
|
| | | if (configs[i].DataMapID == FAIRY_LEAGUE_DUNGEON && fairyLeagueStateValues.Contains(configs[i].StateValue))
|
| | | {
|
| | | fairyLeagueWeekTime.AddStage(configs[i]);
|
| | | }
|
| | | }
|
| | | var specialStateTimes = Config.Instance.GetAllValues<DungeonSpecificlStateTimeConfig>();
|
| | | for (int i = 0; i < specialStateTimes.Count; i++)
|
| | | {
|
| | | var specificlConfig = specialStateTimes[i];
|
| | | if (specificlConfig.DataMapID == FAIRY_LEAGUE_BATTLE && fairyLeagueStateValues.Contains(specificlConfig.StateValue))
|
| | | {
|
| | | Dictionary<int, FairyLeagueWeekTime> dict;
|
| | | if (!specificlLeagueTimes.TryGetValue(specificlConfig.OpenServerWeek, out dict))
|
| | | {
|
| | | dict =new Dictionary<int, FairyLeagueWeekTime>();
|
| | | specificlLeagueTimes.Add(specificlConfig.OpenServerWeek, dict);
|
| | | }
|
| | | var dayOfWeek = 0;
|
| | | var index = GetIndexOfWeek(specificlConfig.OpenServerWeek, specificlConfig.OpenServerDay, out dayOfWeek);
|
| | | FairyLeagueWeekTime leagueTime;
|
| | | if (dict.TryGetValue(index, out leagueTime))
|
| | | {
|
| | | leagueTime = new FairyLeagueWeekTime();
|
| | | dict.Add(index, leagueTime);
|
| | | }
|
| | | leagueTime.AddStage(specificlConfig, dayOfWeek);
|
| | | }
|
| | | }
|
| | | cfg = Config.Instance.Get<FuncConfigConfig>("FamilyMatchResourcePoint");
|
| | |
| | | cfg = Config.Instance.Get<FuncConfigConfig>("FamilyMatchResourcePoint1");
|
| | | crystalRateDict = ConfigParse.GetDic<int, float>(cfg.Numerical1);
|
| | | }
|
| | |
|
| | | int GetIndexOfWeek(int _openWeekDay, int _openDays, out int dayOfWeek)
|
| | | {
|
| | | if (_openWeekDay + _openDays - 1 > 7)
|
| | | {
|
| | | dayOfWeek = _openWeekDay + _openDays - 8;
|
| | | return 1;
|
| | | }
|
| | | dayOfWeek = _openWeekDay + _openDays - 1;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private List<AwardItem> ParseAward(string _config)
|
| | | {
|
| | | List<AwardItem> _list = new List<AwardItem>();
|
| | |
| | | ring.ParseConfig(config);
|
| | | }
|
| | |
|
| | | public void AddStage(DungeonSpecificlStateTimeConfig config, int dayOfWeek)
|
| | | {
|
| | | var ring = rings.Find((x) =>
|
| | | {
|
| | | return x.dayOfWeek == dayOfWeek;
|
| | | });
|
| | | if (ring == null)
|
| | | {
|
| | | ring = new Ring();
|
| | | rings.Add(ring);
|
| | | ring.dayOfWeek = dayOfWeek;
|
| | | }
|
| | | ring.ParseConfig(config, dayOfWeek);
|
| | | }
|
| | |
|
| | | public void Sort()
|
| | | {
|
| | | rings.Sort((Ring x, Ring y) =>
|
| | |
| | | session.ParseConfig(config);
|
| | | }
|
| | |
|
| | | public void ParseConfig(DungeonSpecificlStateTimeConfig config, int dayOfWeek)
|
| | | {
|
| | | var session = sessions.Find((x) =>
|
| | | {
|
| | | return x.session == (config.StateValue < 20 ? 0 : 1);
|
| | | });
|
| | | if (session == null)
|
| | | {
|
| | | session = new Session();
|
| | | session.session = config.StateValue < 20 ? 0 : 1;
|
| | | sessions.Add(session);
|
| | | }
|
| | | session.ParseConfig(config, dayOfWeek);
|
| | | }
|
| | |
|
| | | public bool InRing(DateTime time)
|
| | | {
|
| | | for (int i = 0; i < sessions.Count; i++)
|
| | |
| | | stages.Add(stage);
|
| | | }
|
| | |
|
| | | public void ParseConfig(DungeonSpecificlStateTimeConfig config, int dayOfWeek)
|
| | | {
|
| | | var state = config.StateValue % 10;
|
| | | var stage = new Stage()
|
| | | {
|
| | | stage = state == 1 ? FairyLeagueStage.Grouping : (state == 2 ? FairyLeagueStage.Fight : FairyLeagueStage.Over),
|
| | | dayOfWeek = dayOfWeek,
|
| | | startHour = config.StartHour,
|
| | | endHour = config.EndHour,
|
| | | startMinute = config.StartMinute,
|
| | | endMinute = config.EndMinute
|
| | | };
|
| | | stages.Add(stage);
|
| | | }
|
| | |
|
| | | public bool InSession(DateTime time)
|
| | | {
|
| | | var groupStage = stages.Find((x) =>
|