private void checkWithSameWeight() { long diffLocalTime = SkyTime.ConvertDateToLong(DateTime.Now) - LastSysTime.Value; long diffPhoneStartTime = SkyTime.realTimeSinceOn() - LastPhoneRunTime.Value; long MaxDiff = diffLocalTime > diffPhoneStartTime ? diffLocalTime : diffPhoneStartTime; MaxDiff = LastCountTime.Value > MaxDiff ? LastCountTime.Value : MaxDiff; if (MaxDiff > DelayTime) { IsActive.Save(0L); } else { if (MaxDiff > LastCountTime.Value) { LastCountTime.Save(MaxDiff); } if (MaxDiff > diffLocalTime) { LastSysTime.Value -= (MaxDiff - diffLocalTime); LastSysTime.Save(); } if (MaxDiff > diffPhoneStartTime) { LastPhoneRunTime.Value -= (MaxDiff - diffPhoneStartTime); LastPhoneRunTime.Save(); } } }
public void ActivityStart() { IsActive.Save(1L); LastSysTime.Save(SkyTime.ConvertDateToLong(DateTime.Now)); LastPhoneRunTime.Save(SkyTime.realTimeSinceOn()); LastCountTime.Save(0L); }
public long GetLeftTime() { if (CheckIsEffective()) { long diffPhoneStartTime = SkyTime.realTimeSinceOn() - LastPhoneRunTime.Value; return(DelayTime - diffPhoneStartTime); } return(0); }
public void OnQuit() { if (IsEffective()) { long diffPhoneStartTime = SkyTime.realTimeSinceOn() - LastPhoneRunTime.Value; long MaxDiff = diffPhoneStartTime; if (MaxDiff > DelayTime) { IsActive.Save(0L); } else { LastCountTime.Save(MaxDiff); } } }
public bool CheckIsEffective() { if (!IsEffective()) { return(false); } else { long MaxDiff = SkyTime.realTimeSinceOn() - LastPhoneRunTime.Value; if (MaxDiff > DelayTime) { IsActive.Save(0L); return(false); } else { return(true); } } return(false); }
public GamePlay(ClientType SessionType) { Game.GamePlay = this; _SessionType = SessionType; _InGameUI = new GameUI(); _skyTime = new SkyTime(); _worldManager = new WorldManager(); Network.OnReceivedServerData += OnReceivedServerData; switch (SessionType) { case ClientType.SinglePlayer: _InGameUI.SetCharData(SaveManager.LoadChars()); break; case ClientType.Multiplayer: //Network.RequestServerData(chara.CharName, AuthManager.GetUserId); break; } }