Poodletooth-iLand/toontown/coderedemption/TTCodeRedemptionMgr.py

25 lines
803 B
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from direct.distributed.DistributedObject import DistributedObject
from direct.directnotify.DirectNotifyGlobal import directNotify
class TTCodeRedemptionMgr(DistributedObject):
neverDisable = 1
notify = directNotify.newCategory('TTCodeRedemptionMgr')
def __init__(self, cr):
DistributedObject.__init__(self, cr)
def announceGenerate(self):
DistributedObject.announceGenerate(self)
2015-04-20 09:29:11 -05:00
base.cr.codeRedemptionMgr = self
2015-03-03 16:10:12 -06:00
def delete(self):
2015-04-20 09:29:11 -05:00
if hasattr(base.cr, 'codeRedemptionMgr'):
2015-04-04 05:29:27 -05:00
del base.cr.codeRedemptionMgr
2015-03-03 16:10:12 -06:00
DistributedObject.delete(self)
def redeemCode(self, code, callback):
2015-04-04 05:29:27 -05:00
self.callback = callback
self.sendUpdate('redeemCode', [code])
2015-03-03 16:10:12 -06:00
2015-04-04 05:29:27 -05:00
def redeemCodeResult(self, result):
self.callback(result)