hch
2 天以前 b25049dc4ba2c5974df11ff9c87a1c35902902c6
Main/Utility/TimeUtility.cs
@@ -547,4 +547,40 @@
    {
        return (int)(GetTodayEndTime() - ServerNow).TotalSeconds;
    }
    #region 跨服和本服公用接口
    //当有的功能会从本服功能变成跨服功能的时候统一用这些接口处理时间
    //各自的功能传自己的zoneID
    // 获取当前时间, 公会跨区前取本服时间,跨服后取跨服时间
    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
}