Revert "ai: perhaps fix serverTime"

This reverts commit 2c8d90ca09.
This commit is contained in:
John Cote 2020-01-03 00:07:09 -05:00
parent 2c8d90ca09
commit 2d4ccd6e20

View file

@ -128,8 +128,8 @@ class TimeManager(DistributedObject.DistributedObject):
self.attemptCount += 1 self.attemptCount += 1
self.notify.info('Clock sync roundtrip took %0.3f ms' % (elapsed * 1000.0)) self.notify.info('Clock sync roundtrip took %0.3f ms' % (elapsed * 1000.0))
self.notify.info('AI time delta is %s from server delta' % PythonUtil.formatElapsedSeconds(aiTimeSkew)) self.notify.info('AI time delta is %s from server delta' % PythonUtil.formatElapsedSeconds(aiTimeSkew))
average = (self.start + end) // 2.0 - self.extraSkew average = (self.start + end) / 2.0 - self.extraSkew
uncertainty = (end - self.start) // 2.0 + abs(self.extraSkew) uncertainty = (end - self.start) / 2.0 + abs(self.extraSkew)
globalClockDelta.resynchronize(average, timestamp, uncertainty) globalClockDelta.resynchronize(average, timestamp, uncertainty)
self.notify.info('Local clock uncertainty +/- %.3f s' % globalClockDelta.getUncertainty()) self.notify.info('Local clock uncertainty +/- %.3f s' % globalClockDelta.getUncertainty())
if globalClockDelta.getUncertainty() > self.maxUncertainty: if globalClockDelta.getUncertainty() > self.maxUncertainty: