From 32a26abd79381b92f98b0b3278640d81b98e4eb8 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 6 Jul 2015 22:46:20 +0300 Subject: [PATCH] RIP AccountDate + changed CREATED in Account to uint64 instead of string --- dependencies/astron/dclass/stride.dc | 8 +---- toontown/ai/ToontownAIRepository.py | 3 -- toontown/catalog/AccountDate.py | 39 --------------------- toontown/catalog/AccountDateAI.py | 23 ------------ toontown/toon/LocalToon.py | 3 -- toontown/uberdog/ClientServicesManagerUD.py | 2 +- 6 files changed, 2 insertions(+), 76 deletions(-) delete mode 100755 toontown/catalog/AccountDate.py delete mode 100755 toontown/catalog/AccountDateAI.py diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index a1909d2f..e30e0294 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -27,7 +27,7 @@ dclass Account { uint32 ACCOUNT_AV_SET[] required db; uint32 ESTATE_ID db; AvatarPendingDel ACCOUNT_AV_SET_DEL[] db; - string CREATED db; + uint64 CREATED db; string LAST_LOGIN db; string ACCOUNT_ID db; uint16 ACCESS_LEVEL db; @@ -235,7 +235,6 @@ from toontown.shtiker import NewbiePurchaseManager/AI from toontown.safezone import SafeZoneManager/AI from toontown.tutorial import TutorialManager/AI from toontown.catalog import CatalogManager/AI -from toontown.catalog import AccountDate/AI from toontown.safezone import DistributedTreasure/AI from toontown.coghq import DistributedCashbotBossTreasure/AI from toontown.building import DistributedTrophyMgr/AI @@ -1531,11 +1530,6 @@ dclass CatalogManager : DistributedObject { startCatalog() airecv clsend; }; -dclass AccountDate : DistributedObject { - requestDate() airecv clsend; - requestDateResult(string); -}; - dclass DistributedTreasure : DistributedObject { setTreasureType(uint16) required broadcast ram; setPosition(int16/10, int16/10, int16/10) required broadcast ram; diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 1e3c64e0..62b13812 100755 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -15,7 +15,6 @@ from toontown.ai.NewsManagerAI import NewsManagerAI from toontown.ai.QuestManagerAI import QuestManagerAI from toontown.ai.DistributedBlackCatMgrAI import DistributedBlackCatMgrAI from toontown.ai.DistributedReportMgrAI import DistributedReportMgrAI -from toontown.catalog.AccountDateAI import AccountDateAI from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI from toontown.catalog.CatalogManagerAI import CatalogManagerAI @@ -118,8 +117,6 @@ class ToontownAIRepository(ToontownInternalRepository): self.cogPageManager = CogPageManagerAI.CogPageManagerAI() self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self) self.codeRedemptionMgr.generateWithRequired(2) - self.accountDateMgr = AccountDateAI(self) - self.accountDateMgr.generateWithRequired(2) self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self) self.buildingQueryMgr.generateWithRequired(2) self.groupManager.generateWithRequired(2) diff --git a/toontown/catalog/AccountDate.py b/toontown/catalog/AccountDate.py deleted file mode 100755 index 32f37780..00000000 --- a/toontown/catalog/AccountDate.py +++ /dev/null @@ -1,39 +0,0 @@ -from direct.distributed.DistributedObject import DistributedObject -from direct.directnotify.DirectNotifyGlobal import directNotify -from datetime import datetime - -class AccountDate(DistributedObject): - neverDisable = 1 - notify = directNotify.newCategory('AccountDate') - - def __init__(self, cr): - DistributedObject.__init__(self, cr) - self.accountDays = 0 - - def announceGenerate(self): - DistributedObject.announceGenerate(self) - base.cr.accountDateMgr = self - taskMgr.doMethodLater(10, self.requestDate, 'request-task') - - def delete(self): - if hasattr(base.cr, 'accountDateMgr'): - if base.cr.accountDateMgr is self: - del base.cr.accountDateMgr - DistributedObject.delete(self) - - def getAccountDays(self): - return self.accountDays - - def requestDate(self, task=None): - self.sendUpdate('requestDate') - - if task is not None: - return task.done - - def requestDateResult(self, result): - if result is None: - notify.warning('Invalid response from server.') - self.accountDays = 0 - else: - date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y") - self.accountDays = (datetime.now() - date).days diff --git a/toontown/catalog/AccountDateAI.py b/toontown/catalog/AccountDateAI.py deleted file mode 100755 index 57794b1b..00000000 --- a/toontown/catalog/AccountDateAI.py +++ /dev/null @@ -1,23 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectAI import DistributedObjectAI - -class AccountDateAI(DistributedObjectAI): - notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI") - - def announceGenerate(self): - DistributedObjectAI.announceGenerate(self) - - def requestDate(self): - avId = self.air.getAvatarIdFromSender() - av = self.air.doId2do.get(avId) - - if not av: - return - - def callback(dclass, fields): - if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and 'CREATED' in fields: - self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')]) - else: - self.sendUpdateToAvatarId(avId, 'requestDateResult', [None]) - - self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback) diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index c8e09d90..204215c2 100755 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -1662,9 +1662,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): DistributedToon.DistributedToon.setPinkSlips(self, pinkSlips) self.inventory.updateTotalPropsText() - def getAccountDays(self): - return base.cr.accountDateMgr.getAccountDays() - def hasActiveBoardingGroup(self): if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty: return localAvatar.boardingParty.hasActiveGroup(localAvatar.doId) diff --git a/toontown/uberdog/ClientServicesManagerUD.py b/toontown/uberdog/ClientServicesManagerUD.py index 0b6ef64e..abdeda0f 100755 --- a/toontown/uberdog/ClientServicesManagerUD.py +++ b/toontown/uberdog/ClientServicesManagerUD.py @@ -329,7 +329,7 @@ class LoginAccountFSM(OperationFSM): 'ACCOUNT_AV_SET': [0] * 6, 'ESTATE_ID': 0, 'ACCOUNT_AV_SET_DEL': [], - 'CREATED': time.ctime(), + 'CREATED': time.time(), 'LAST_LOGIN': time.ctime(), 'LAST_LOGIN_TS': time.time(), 'ACCOUNT_ID': str(self.userId),