2015-03-09 17:11:27 -05:00
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
|
|
|
from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
|
|
|
|
|
|
|
class AccountDateAI(DistributedObjectAI):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI")
|
2015-07-05 18:59:25 -05:00
|
|
|
|
2015-03-09 17:11:27 -05:00
|
|
|
def announceGenerate(self):
|
|
|
|
DistributedObjectAI.announceGenerate(self)
|
2015-07-05 18:59:25 -05:00
|
|
|
|
2015-03-09 17:11:27 -05:00
|
|
|
def requestDate(self):
|
|
|
|
avId = self.air.getAvatarIdFromSender()
|
|
|
|
av = self.air.doId2do.get(avId)
|
|
|
|
|
|
|
|
if not av:
|
|
|
|
return
|
2015-07-05 18:59:25 -05:00
|
|
|
|
2015-03-09 17:11:27 -05:00
|
|
|
def callback(dclass, fields):
|
|
|
|
if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'):
|
|
|
|
self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')])
|
|
|
|
else:
|
|
|
|
self.sendUpdateToAvatarId(avId, 'requestDateResult', [None])
|
2015-07-05 18:59:25 -05:00
|
|
|
|
|
|
|
self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback)
|