void GetTimeStamp() { if (Game.CurrentGame.ReplayController == null) { return; } byte[] ts = new byte[8]; client.ReplayStream.Read(ts, 0, 8); Int64 last = BitConverter.ToInt64(ts, 0); if (lastTS != 0) { Int64 toSleep = last - lastTS; ReplayController controller = Game.CurrentGame.ReplayController; if (!controller.NoDelays) { if (controller.EvenDelays) { toSleep = ReplayController.EvenReplayBaseSpeedInMs; } if (controller.Speed != 0) { toSleep = (Int64)(((double)toSleep) / controller.Speed); } controller.Lock(); controller.Unlock(); Thread.Sleep((int)toSleep); } } lastTS = last; }