From 45def83a346909bed92c2537e84dadbe9d1e18c3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Mar 2015 22:10:21 +0200 Subject: [PATCH] Remove unused StatusDatabase --- astron/dclass/otp.dc | 6 ---- otp/distributed/DCClassImports.py | 5 ++- otp/status/StatusDatabase.py | 53 ------------------------------- otp/status/StatusDatabaseUD.py | 12 ------- otp/status/__init__.py | 0 5 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 otp/status/StatusDatabase.py delete mode 100644 otp/status/StatusDatabaseUD.py delete mode 100644 otp/status/__init__.py diff --git a/astron/dclass/otp.dc b/astron/dclass/otp.dc index f269e245..ece09dd6 100644 --- a/astron/dclass/otp.dc +++ b/astron/dclass/otp.dc @@ -20,7 +20,6 @@ from otp.distributed import DistributedDirectory/AI from otp.distributed import DistributedTestObject/AI from otp.chat import ChatAgent/UD from otp.distributed import CentralLogger/AI/UD -from otp.status import StatusDatabase/UD from otp.avatar import AvatarHandle typedef uint8 bool; @@ -437,11 +436,6 @@ dclass CentralLogger : DistributedObject { logAIGarbage() airecv; }; -dclass StatusDatabase : DistributedObject { - requestOfflineAvatarStatus(uint32 []) airecv clsend; - recvOfflineAvatarStatus(uint32, uint32); -}; - dclass CallbackObject { callback(uint32, bool, uint8); }; diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 382e63e6..1a3f97f4 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,10 +2,9 @@ from pandac.PandaModules import * -hashVal = 1411931781 +hashVal = 1516203465 -from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot from toontown.golf import DistributedPhysicsWorld, DistributedGolfHole, DistributedGolfCourse from toontown.building import DistributedAnimatedProp, DistributedTrophyMgr, DistributedBuilding, DistributedAnimBuilding, DistributedBuildingQueryMgr, DistributedToonInterior, DistributedToonHallInterior, DistributedSuitInterior, DistributedHQInterior, DistributedGagshopInterior, DistributedPetshopInterior, DistributedKartShopInterior, DistributedBankInterior, DistributedBankCollectable, DistributedLibraryInterior, DistributedDoor, DistributedAnimDoor, DistributedKnockKnockDoor, DistributedElevator, DistributedElevatorFSM, DistributedElevatorExt, DistributedElevatorInt, DistributedElevatorFloor, DistributedBossElevator, DistributedVPElevator, DistributedCFOElevator, DistributedCJElevator, DistributedBBElevator, DistributedBoardingParty, DistributedTutorialInterior, DistributedClubElevator @@ -41,7 +40,7 @@ from toontown.parties import DistributedParty, DistributedPartyActivity, Distrib from toontown.uberdog.DistributedInGameNewsMgr import DistributedInGameNewsMgr from toontown.coghq.InGameEditorDCImports import * from toontown.friends import TTPlayerFriendsManager, TTUFriendsManager -from otp.status import StatusDatabase +from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog from toontown.uberdog.DistributedSecurityMgr import DistributedSecurityMgr from otp.distributed import Account, ObjectServer, DistributedDistrict, DistributedDirectory, DistributedTestObject, CentralLogger from toontown.estate import DistributedCannon, DistributedTarget, EstateManager, DistributedEstate, DistributedHouse, DistributedHouseInterior, DistributedGarden, DistributedHouseDoor, DistributedBankMgr, DistributedMailbox, DistributedFurnitureManager, DistributedFurnitureItem, DistributedBank, DistributedCloset, DistributedTrunk, DistributedPhone, DistributedFireworksCannon, DistributedLawnDecor, DistributedGardenPlot, DistributedGardenBox, DistributedFlower, DistributedGagTree, DistributedStatuary, DistributedToonStatuary, DistributedChangingStatuary, DistributedAnimatedStatuary, DistributedPlantBase, DistributedLawnDecor diff --git a/otp/status/StatusDatabase.py b/otp/status/StatusDatabase.py deleted file mode 100644 index 75083a86..00000000 --- a/otp/status/StatusDatabase.py +++ /dev/null @@ -1,53 +0,0 @@ -import datetime -import time -from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal -from direct.directnotify.DirectNotifyGlobal import directNotify -from otp.otpbase import OTPLocalizer - -class StatusDatabase(DistributedObjectGlobal): - notify = directNotify.newCategory('StatusDatabase') - - def __init__(self, cr): - DistributedObjectGlobal.__init__(self, cr) - self.avatarData = {} - self.avatarQueue = [] - self.avatarRequestTaskName = 'StatusDataBase_RequestAvatarLastOnline' - self.avatarRetreiveTaskName = 'StatusDataBase_GetAvatarLastOnline' - self.avatarDoneTaskName = 'StatusDataBase GotAvatarData' - - def requestOfflineAvatarStatus(self, avIds): - self.notify.debugCall() - self.sendUpdate('requestOfflineAvatarStatus', [avIds]) - - def queueOfflineAvatarStatus(self, avIds): - for avId in avIds: - if avId not in self.avatarQueue: - self.avatarQueue.append(avId) - - while taskMgr.hasTaskNamed(self.avatarRequestTaskName): - taskMgr.remove(self.avatarRequestTaskName) - - task = taskMgr.doMethodLater(1.0, self.requestAvatarQueue, self.avatarRequestTaskName) - - def requestAvatarQueue(self, task): - self.sendUpdate('requestOfflineAvatarStatus', [self.avatarQueue]) - self.avatarQueue = [] - - def recvOfflineAvatarStatus(self, avId, lastOnline): - self.notify.debugCall() - self.notify.debug('Got an update for offline avatar %s who was last online %s' % (avId, self.lastOnlineString(lastOnline))) - self.avatarData[avId] = lastOnline - while taskMgr.hasTaskNamed(self.avatarRetreiveTaskName): - taskMgr.remove(self.avatarRetreiveTaskName) - - task = taskMgr.doMethodLater(1.0, self.announceNewAvatarData, self.avatarRetreiveTaskName) - - def announceNewAvatarData(self, task): - messenger.send(self.avatarDoneTaskName) - - def lastOnlineString(self, timestamp): - if timestamp == 0: - return '' - now = datetime.datetime.utcnow() - td = abs(now - datetime.datetime.fromtimestamp(timestamp)) - return OTPLocalizer.timeElapsedString(td) diff --git a/otp/status/StatusDatabaseUD.py b/otp/status/StatusDatabaseUD.py deleted file mode 100644 index b2e31ab3..00000000 --- a/otp/status/StatusDatabaseUD.py +++ /dev/null @@ -1,12 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectUD import DistributedObjectUD - -class StatusDatabaseUD(DistributedObjectUD): - notify = DirectNotifyGlobal.directNotify.newCategory("StatusDatabaseUD") - - def requestOfflineAvatarStatus(self, todo0): - pass - - def recvOfflineAvatarStatus(self, todo0, todo1): - pass - diff --git a/otp/status/__init__.py b/otp/status/__init__.py deleted file mode 100644 index e69de29b..00000000