internal void Init(MailSystem mailSystem) { m_MailSystem = mailSystem; mailSystem.RegisterModuleMailHandler(ModuleMailTypeEnum.GowModule, this); GowFormulaConfig cfg1 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.Upper); GowFormulaConfig cfg2 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.Lower); GowFormulaConfig cfg3 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.K2_1); GowFormulaConfig cfg4 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.K2_2); GowFormulaConfig cfg5 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.K1); GowFormulaConfig cfg6 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.K3); GowFormulaConfig cfg7 = GowConfigProvider.Instance.GetGowFormulaConfig((int)GowFormulaConfig.FormulaNameEnum.TC); if (null != cfg1 && cfg1.m_Value > 0) { m_Upper = cfg1.m_Value; } if (null != cfg2 && cfg2.m_Value > 0) { m_Lower = cfg2.m_Value; } if (null != cfg3 && cfg3.m_Value > 0) { m_K2_1 = cfg3.m_Value; } if (null != cfg4 && cfg4.m_Value > 0) { m_K2_2 = cfg4.m_Value; } if (null != cfg5 && cfg5.m_Value > 0) { m_K1 = cfg5.m_Value; } if (null != cfg6 && cfg6.m_Value > 0) { m_K3 = cfg6.m_Value; } if (null != cfg7 && cfg7.m_Value > 0) { m_TC = cfg7.m_Value; } List <GowTimeConfig> times = GowConfigProvider.Instance.GowTimeConfigMgr.GetData(); foreach (GowTimeConfig cfg in times) { if ((int)GowTimeConfig.TimeTypeEnum.PrizeTime == cfg.m_Type) { m_PrizeTime = new Time(cfg.m_StartHour, cfg.m_StartMinute, cfg.m_StartSecond); } else { GowTime time = new GowTime(); time.m_StartTime = new Time(cfg.m_StartHour, cfg.m_StartMinute, cfg.m_StartSecond); time.m_EndTime = new Time(cfg.m_EndHour, cfg.m_EndMinute, cfg.m_EndSecond); m_GowTimes.Add(time); } } InitGowRankData(); InitGowPrizeData(); }
internal static bool CanMatch() { bool ret = false; DateTime time = DateTime.Now; int seconds = Time.CalcSeconds(time.Hour, time.Minute, time.Second); int ct = m_GowTimes.Count; for (int ix = 0; ix < ct; ++ix) { GowTime gowTime = m_GowTimes[ix]; int start = gowTime.m_StartTime.CalcSeconds(); int end = gowTime.m_EndTime.CalcSeconds(); if (seconds >= start && seconds <= end) { ret = true; break; } } return(ret); }