From b25049dc4ba2c5974df11ff9c87a1c35902902c6 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 07 二月 2026 16:24:02 +0800
Subject: [PATCH] 66 【公会】基础主体 - 跨服和本服公用时间接口
---
Main/Utility/TimeUtility.cs | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/Main/Utility/TimeUtility.cs b/Main/Utility/TimeUtility.cs
index ed856e8..ef8a4a1 100644
--- a/Main/Utility/TimeUtility.cs
+++ b/Main/Utility/TimeUtility.cs
@@ -547,4 +547,40 @@
{
return (int)(GetTodayEndTime() - ServerNow).TotalSeconds;
}
+
+ #region 璺ㄦ湇鍜屾湰鏈嶅叕鐢ㄦ帴鍙�
+ //褰撴湁鐨勫姛鑳戒細浠庢湰鏈嶅姛鑳藉彉鎴愯法鏈嶅姛鑳界殑鏃跺�欑粺涓�鐢ㄨ繖浜涙帴鍙e鐞嗘椂闂�
+ //鍚勮嚜鐨勫姛鑳戒紶鑷繁鐨剒oneID
+
+ // 鑾峰彇褰撳墠鏃堕棿, 鍏細璺ㄥ尯鍓嶅彇鏈湇鏃堕棿锛岃法鏈嶅悗鍙栬法鏈嶆椂闂�
+ public static DateTime GetCommServerNow(int zoneID = 0)
+ {
+ if (zoneID == 0)
+ {
+ return ServerNow;
+ }
+ else
+ {
+ return CrossServerNow;
+ }
+ }
+
+ public static int GetCommServerTick(int zoneID = 0)
+ {
+ if (zoneID == 0)
+ {
+ return AllSeconds;
+ }
+ else
+ {
+ return AllSecondsCrossServer;
+ }
+ }
+
+ public static DateTime GetCommTodayEndTime(int zoneID = 0)
+ {
+ var now = GetCommServerNow(zoneID).AddDays(1);
+ return new DateTime(now.Year, now.Month, now.Day);
+ }
+ #endregion
}
--
Gitblit v1.8.0