| | |
| | | } |
| | | |
| | | public static event Action OnServerOpenDayRefresh; |
| | | public static void OnRefreshServerOpenDay(HA005_tagOpenServerDay package) |
| | | public static void OnRefreshServerOpenDay(HA103_tagMCOpenServerDay package) |
| | | { |
| | | { |
| | | OpenDay = package.Day; |
| | |
| | | |
| | | } |
| | | |
| | | // 到10点还要多少秒,如果已经过了10点,返回0 |
| | | public static int GetToTenClockSeconds() |
| | | // 今日到x点还要多少秒,如果已经过了x点,返回0 |
| | | public static int GetToTheHourSeconds(int hour=10) |
| | | { |
| | | var now = ServerNow; |
| | | if (now.Hour < 10) |
| | | if (now.Hour < hour) |
| | | { |
| | | return (int)(ServerNow - new DateTime(now.Year, now.Month, now.Day, 10, 0, 0)).TotalSeconds; |
| | | return (int)(new DateTime(now.Year, now.Month, now.Day, hour, 0, 0) - ServerNow).TotalSeconds; |
| | | } |
| | | return 0; |
| | | } |