|
@@ -1,5 +1,6 @@
|
|
using ET;
|
|
using ET;
|
|
using FairyGUI;
|
|
using FairyGUI;
|
|
|
|
+using static UnityEngine.UI.CanvasScaler;
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -10,8 +11,10 @@ namespace GFGGame
|
|
private static int _heartbeatCDEnd = 0;
|
|
private static int _heartbeatCDEnd = 0;
|
|
public static void StartUpdate()
|
|
public static void StartUpdate()
|
|
{
|
|
{
|
|
- _heartbeatCDEnd = ServerDataManager.currentTimeSecs + INTERVAL_HEARTBEAT;
|
|
|
|
|
|
+ int currentTimeSecs = (int)(Game.TimeInfo.ServerNow() / 1000);
|
|
|
|
+ _heartbeatCDEnd = currentTimeSecs + INTERVAL_HEARTBEAT;
|
|
StopUpdate();
|
|
StopUpdate();
|
|
|
|
+ //每秒检测
|
|
Timers.inst.Add(1, 0, OnUpdate);
|
|
Timers.inst.Add(1, 0, OnUpdate);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -22,27 +25,26 @@ namespace GFGGame
|
|
|
|
|
|
private static void OnUpdate(object param)
|
|
private static void OnUpdate(object param)
|
|
{
|
|
{
|
|
- if(!RoleDataManager.powerTimeLock &&!RoleDataManager.CheckPowerFull())
|
|
|
|
|
|
+ int currentTimeSecs = (int)(Game.TimeInfo.ServerNow() / 1000);
|
|
|
|
+ if (!RoleDataManager.powerTimeServerLock &&!RoleDataManager.CheckPowerFull())
|
|
{
|
|
{
|
|
int powerTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerTime);
|
|
int powerTime = GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerTime);
|
|
- int passTime = ServerDataManager.currentTimeSecs - powerTime;
|
|
|
|
|
|
+ int passTime = currentTimeSecs - powerTime;
|
|
if(passTime >= GameConst.INTERVAL_TIME_SECONDS_POWER)
|
|
if(passTime >= GameConst.INTERVAL_TIME_SECONDS_POWER)
|
|
{
|
|
{
|
|
- RoleDataManager.powerTimeLock = true;
|
|
|
|
|
|
+ RoleDataManager.powerTimeServerLock = true;
|
|
NumericHelper.RequestAddAttributePoint(GameGlobal.zoneScene, NumericType.Power).Coroutine();
|
|
NumericHelper.RequestAddAttributePoint(GameGlobal.zoneScene, NumericType.Power).Coroutine();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- int currentTimeSecs = ServerDataManager.currentTimeSecs;
|
|
|
|
if(currentTimeSecs >= _heartbeatCDEnd)
|
|
if(currentTimeSecs >= _heartbeatCDEnd)
|
|
{
|
|
{
|
|
//GameProxy.ReqUpdateTime();
|
|
//GameProxy.ReqUpdateTime();
|
|
_heartbeatCDEnd = currentTimeSecs + INTERVAL_HEARTBEAT;
|
|
_heartbeatCDEnd = currentTimeSecs + INTERVAL_HEARTBEAT;
|
|
}
|
|
}
|
|
- int day = ServerDataManager.CurrentDay;
|
|
|
|
- int recommendDay = GameGlobal.myNumericComponent.GetAsInt(ET.NumericType.RecommendCount);
|
|
|
|
- if(recommendDay >= 0 && recommendDay != day)
|
|
|
|
|
|
+ int dailyResetSecs = GameGlobal.myNumericComponent.GetAsInt(NumericType.DailyResetSecs);
|
|
|
|
+ if (TimeHelper.ServerNowSecs >= dailyResetSecs)
|
|
{
|
|
{
|
|
- StoryDataManager.ResetDailyData();
|
|
|
|
|
|
+ RoleSproxy.ResetDailyData().Coroutine();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|