oldschool-toontown/otp/ai/TimeManagerAI.py

18 lines
634 B
Python
Raw Normal View History

2019-11-08 22:55:55 -06:00
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.distributed.ClockDelta import globalClockDelta
import time
2019-11-08 22:55:55 -06:00
class TimeManagerAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory('TimeManagerAI')
def requestServerTime(self, context):
avId = self.air.getAvatarIdFromSender()
if not avId:
return
self.sendUpdateToAvatarId(avId, 'serverTime', [context, globalClockDelta.getRealNetworkTime(bits=32), int(time.time())])
def setSignature(self, todo0, todo1, todo2):
pass