| | |
| | | } |
| | | |
| | | public static event Action OnServerOpenDayRefresh; |
| | | public static void OnRefreshServerOpenDay(HA005_tagOpenServerDay package) |
| | | public static void OnRefreshServerOpenDay(HA103_tagMCOpenServerDay package) |
| | | { |
| | | { |
| | | OpenDay = package.Day; |
| | |
| | | int seconds = _seconds % 60; |
| | | return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2")); |
| | | } |
| | | |
| | | |
| | | //详细显示 |
| | | //xx小时xx分XX秒 |
| | | //xx分XX秒 |
| | | //xx秒 |
| | | public static string SecondsToHMSEx(int _seconds) |
| | | { |
| | | int hours = _seconds % 86400 / 3600; |
| | | int mins = _seconds % 3600 / 60; |
| | | int seconds = _seconds % 60; |
| | | if (hours > 0) |
| | | { |
| | | return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073"), seconds, Language.Get("L1075")); |
| | | } |
| | | else if (mins > 0) |
| | | { |
| | | return StringUtility.Contact(mins, Language.Get("L1073"), seconds, Language.Get("L1075")); |
| | | } |
| | | else |
| | | { |
| | | return StringUtility.Contact(seconds, Language.Get("L1075")); |
| | | } |
| | | } |
| | | |
| | | |
| | | //例子;分:秒 |
| | | //xx:xx |
| | |
| | | } |
| | | |
| | | //极简显示 |
| | | // x天x小时 |
| | | // x小时x分 |
| | | // x天 或者 x天x小时 |
| | | // x小时 或者 x小时x分 |
| | | // x分 |
| | | // x秒 |
| | | public static string SecondsToShortDHMS(int _seconds) |
| | |
| | | int seconds = _seconds % 60; |
| | | if (days > 0) |
| | | { |
| | | if (hours == 0) |
| | | { |
| | | return StringUtility.Contact(days, Language.Get("L1074")); |
| | | } |
| | | return StringUtility.Contact(days, Language.Get("L1074"), hours, Language.Get("L1072")); |
| | | } |
| | | else if (hours > 0) |
| | | { |
| | | if (mins == 0) |
| | | { |
| | | return StringUtility.Contact(hours, Language.Get("L1072")); |
| | | } |
| | | return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073")); |
| | | } |
| | | else if (mins > 0) |
| | |
| | | } |
| | | return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2")); |
| | | } |
| | | |
| | | |
| | | //例子 |
| | | //x天 |
| | | //x时 |
| | | //x分x秒 |
| | | //x分 |
| | | //x秒 |
| | | public static string SecondsToConsumeRebate(int _seconds) |
| | | { |
| | |
| | | } |
| | | else if (hours >= 1) |
| | | { |
| | | return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("Hour")); |
| | | return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("L1072")); |
| | | } |
| | | else if (mins >= 1) |
| | | { |
| | | return StringUtility.Contact(mins, Language.Get("Minute"), seconds, Language.Get("RealmWin_Bewrite_35")); |
| | | return StringUtility.Contact(mins, Language.Get("L1073")); |
| | | } |
| | | else |
| | | { |
| | | return StringUtility.Contact(seconds, Language.Get("RealmWin_Bewrite_35")); |
| | | return StringUtility.Contact(seconds, Language.Get("L1075")); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | // 到10点还要多少秒,如果已经过了10点,返回0 |
| | | public static int GetToTenClockSeconds() |
| | | { |
| | | var now = ServerNow; |
| | | if (now.Hour < 10) |
| | | { |
| | | return (int)(ServerNow - new DateTime(now.Year, now.Month, now.Day, 10, 0, 0)).TotalSeconds; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //开服天结束倒计时;单位秒 |
| | | public static int GetRemindTimeByOpenDay(int days) |
| | | { |