mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
26 lines
804 B
Python
26 lines
804 B
Python
|
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)
|
||
|
base.cr.codeRedemptionMgr = self
|
||
|
|
||
|
def delete(self):
|
||
|
if hasattr(base.cr, 'codeRedemptionMgr'):
|
||
|
del base.cr.codeRedemptionMgr
|
||
|
DistributedObject.delete(self)
|
||
|
|
||
|
def redeemCode(self, code, callback):
|
||
|
self.callback = callback
|
||
|
self.sendUpdate('redeemCode', [code])
|
||
|
|
||
|
def redeemCodeResult(self, result):
|
||
|
self.callback(result)
|