public DateTime GetMonthGameEndTime(Byte MonthID) { tagMonthConfig MonthConfig; if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(MonthID, out MonthConfig)) { DateTime pTime = new DateTime(); return(pTime); } Byte TimeID = MonthConfig.NowIsInStartTime(); if (TimeID != 0) { //获取当前的 tagMonthTime pTimeInfo; if (!MonthConfig.m_MonthTime.TryGetValue(TimeID, out pTimeInfo)) { DateTime pTime = new DateTime(); return(pTime); } DateTime EndTime = pTimeInfo.GetNowOrNextStarTime().AddMinutes(pTimeInfo.SratLastMin); //EndTime = EndTime.AddMilliseconds(EndTime.Millisecond * -1).AddSeconds(EndTime.Second * -1); return(FishConfig.Instance.GetMinDateTime(EndTime)); } else { DateTime pTime = new DateTime(); return(pTime); } }
public bool MonthIsInStar(Byte Month)//是否在比赛 { tagMonthConfig MonthConfig; if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig)) { return(false); } return(MonthConfig.NowIsInStartTime() != 0); }
public bool MonthIsStop(Byte Month)//是否已经结束 等待下一次 { tagMonthConfig MonthConfig; if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig)) { return(false); } return((MonthConfig.NowIsInSignTime() == 0) && (MonthConfig.NowIsInStartTime() == 0)); }
public bool GetMonthNowOrNextStarTime(Byte Month, out DateTime DateBeginTime, out DateTime DateEndTime) { //获取最近的一次的报名时间 如果当前处在报名节点 返回当前正在进行的时间段用于显示 //获取下次报名的开始时间 已经持续的分钟数 tagMonthConfig MonthConfig; if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig)) { DateBeginTime = new DateTime(); DateEndTime = new DateTime(); return(false); } Byte TimeID = MonthConfig.NowIsInStartTime(); if (TimeID != 0) { //获取当前的 tagMonthTime pTimeInfo; if (!MonthConfig.m_MonthTime.TryGetValue(TimeID, out pTimeInfo)) { DateBeginTime = new DateTime(); DateEndTime = new DateTime(); return(false); } DateBeginTime = pTimeInfo.GetNowOrNextStarTime(); DateEndTime = DateBeginTime.AddMinutes(pTimeInfo.SratLastMin); return(true); } else { //获取最近的 //获取当前比赛 最近的一个 比赛范围 DateTime LogTime = new DateTime(); UInt16 LastMin = 0; foreach (tagMonthTime var in MonthConfig.m_MonthTime.Values) { if (LastMin == 0) { LogTime = var.GetNowOrNextStarTime(); LastMin = var.SratLastMin; continue; } DateTime StarTime = var.GetNowOrNextStarTime(); if ((StarTime - LogTime).TotalSeconds > 0) { LogTime = StarTime; LastMin = var.SratLastMin; continue; } } DateBeginTime = LogTime; DateEndTime = LogTime.AddMinutes(LastMin); return(true); } }