historical/toontown-classic.git/toontown/uberdog/DistributedDeliveryManagerAI.py
2024-01-16 11:20:27 -06:00

20 lines
712 B
Python

from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectGlobalAI import DistributedObjectGlobalAI
from toontown.catalog import CatalogItem
class DistributedDeliveryManagerAI(DistributedObjectGlobalAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedDeliveryManagerAI')
def sendDeliverGifts(self, avId, now):
if not avId:
return
av = self.air.doId2do.get(avId)
if not av:
return
_, remainingGifts = av.onGiftOrder.extractDeliveryItems(now)
av.sendUpdate('setGiftSchedule',
[remainingGifts.getBlob(store=CatalogItem.Customization | CatalogItem.DeliveryDate)])