public ThreadTimer(long nextexpiredTime, long lastHandleTime, HeartbeatCallback pHeartbeatCallback, long interval, long sequence, bool ifPersist) { this.nextexpiredTime = nextexpiredTime; this.lastHandleTime = lastHandleTime; this.pHeartbeatCallback = pHeartbeatCallback; this.interval = interval; this.sequence = sequence; this.ifPersist = ifPersist; }
public long AddTimer(HeartbeatCallback pHeartbeatCallback, long interval, bool ifPersist) { long nowTime = this.internalTime; long seqID = this.timerSequence; long nextTime = nowTime + interval; ThreadTimer lThreadTimer = new ThreadTimer(nextTime, nowTime, pHeartbeatCallback, interval, seqID, ifPersist); this._toAddTimer.Add(lThreadTimer); return(seqID); }
public void setHeartbeatCallback(HeartbeatCallback callback) { lock(this) { _heartbeatCallback = callback; } }
public void RegisterCallback(HeartbeatCallback callback) { _heartbeatCallback = callback; }
public void RegisterCallback(HeartbeatCallback callback) { _scriptManager.RegisterCallback(callback); }
public long AddTimer(HeartbeatCallback pHeartbeatCallback, long interval, bool ifPersist) => this.battleTimer.AddTimer(pHeartbeatCallback, interval, ifPersist);