From e9729a2ba6ffe237461ae8a615b16535f1946046 Mon Sep 17 00:00:00 2001 From: DenialMC Date: Wed, 8 Apr 2015 20:28:00 +0300 Subject: [PATCH] We don't need this --- astron/dclass/united.dc | 5 -- otp/avatar/DistributedPlayerAI.py | 6 +-- otp/distributed/ClsendTracker.py | 58 ---------------------- otp/distributed/DCClassImports.py | 4 +- otp/distributed/DistributedDirectory.py | 4 -- otp/distributed/DistributedDirectoryAI.py | 9 ---- otp/distributed/OTPClientRepository.py | 2 - toontown/uberdog/ToontownUberRepository.py | 4 -- 8 files changed, 3 insertions(+), 89 deletions(-) delete mode 100644 otp/distributed/ClsendTracker.py delete mode 100644 otp/distributed/DistributedDirectory.py delete mode 100644 otp/distributed/DistributedDirectoryAI.py diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index 3c9a91f3..aa64983c 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -14,7 +14,6 @@ from otp.friends import GuildManager/AI/UD from otp.friends import FriendInfo from otp.friends import AvatarFriendInfo from otp.distributed import DistributedDistrict/AI/UD -from otp.distributed import DistributedDirectory/AI from otp.chat import ChatAgent/UD from otp.avatar import AvatarHandle @@ -87,10 +86,6 @@ dclass TimeManager : DistributedObject { checkAvOnDistrictResult(uint32 context, DoId av, bool isOnDistrict); }; -dclass DistributedDirectory : DistributedObject { - setParentingRules(string, string) broadcast ram; -}; - dclass DistributedDistrict : DistributedObject { setName(string) required broadcast ram; setAvailable(uint8) required broadcast ram; diff --git a/otp/avatar/DistributedPlayerAI.py b/otp/avatar/DistributedPlayerAI.py index ae17124d..64b68312 100644 --- a/otp/avatar/DistributedPlayerAI.py +++ b/otp/avatar/DistributedPlayerAI.py @@ -7,15 +7,13 @@ from otp.ai.MagicWordGlobal import * from otp.avatar import DistributedAvatarAI from otp.avatar import PlayerBase from otp.distributed import OtpDoGlobals -from otp.distributed.ClsendTracker import ClsendTracker from otp.otpbase import OTPLocalizer -class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.PlayerBase, ClsendTracker): +class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.PlayerBase): def __init__(self, air): DistributedAvatarAI.DistributedAvatarAI.__init__(self, air) PlayerBase.PlayerBase.__init__(self) - ClsendTracker.__init__(self) self.friendsList = [] self.DISLname = '' self.DISLid = 0 @@ -29,7 +27,6 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl def announceGenerate(self): DistributedAvatarAI.DistributedAvatarAI.announceGenerate(self) - ClsendTracker.announceGenerate(self) self._doPlayerEnter() def _announceArrival(self): @@ -47,7 +44,6 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl if __dev__: del self._sentExitServerEvent self._doPlayerExit() - ClsendTracker.destroy(self) if __dev__: GarbageReport.checkForGarbageLeaks() DistributedAvatarAI.DistributedAvatarAI.delete(self) diff --git a/otp/distributed/ClsendTracker.py b/otp/distributed/ClsendTracker.py deleted file mode 100644 index 85cb1ef1..00000000 --- a/otp/distributed/ClsendTracker.py +++ /dev/null @@ -1,58 +0,0 @@ -from pandac.PandaModules import StringStream -from direct.distributed.PyDatagram import PyDatagram -import random - -class ClsendTracker: - clsendNotify = directNotify.newCategory('clsend') - NumTrackersLoggingOverflow = 0 - MaxTrackersLoggingOverflow = config.GetInt('max-clsend-loggers', 5) - - def __init__(self): - self._logClsendOverflow = False - if self.isPlayerControlled(): - if simbase.air.getTrackClsends(): - if ClsendTracker.NumTrackersLoggingOverflow < ClsendTracker.MaxTrackersLoggingOverflow: - self._logClsendOverflow = random.random() < 1.0 / config.GetFloat('clsend-log-one-av-in-every', choice(__dev__, 4, 50)) - if self._logClsendOverflow: - ClsendTracker.NumTrackersLoggingOverflow += 1 - self._clsendMsgs = [] - self._clsendBufLimit = 100 - self._clsendFlushNum = 20 - self._clsendCounter = 0 - - def announceGenerate(self): - if self._logClsendOverflow: - self.clsendNotify.info('logging all clsends for %s' % self.doId) - - def destroy(self): - if self._logClsendOverflow: - ClsendTracker.NumTrackersLoggingOverflow -= 1 - - def trackClientSendMsg(self, dataStr): - self._clsendMsgs.append((self.air.getAvatarIdFromSender(), dataStr)) - if len(self._clsendMsgs) >= self._clsendBufLimit: - self._trimClsend() - - def _trimClsend(self): - for i in xrange(self._clsendFlushNum): - if self._logClsendOverflow: - self._logClsend(*self._clsendMsgs[0]) - self._clsendMsgs = self._clsendMsgs[1:] - self._clsendCounter += 1 - - def _logClsend(self, senderId, dataStr): - msgStream = StringStream() - simbase.air.describeMessage(msgStream, '', dataStr) - readableStr = msgStream.getData() - sstream = StringStream() - PyDatagram(dataStr).dumpHex(sstream) - hexDump = sstream.getData() - self.clsendNotify.info('%s [%s]: %s%s' % (self.doId, - self._clsendCounter, - readableStr, - hexDump)) - - def dumpClientSentMsgs(self): - for msg in self._clsendMsgs: - self._logClsend(*msg) - self._clsendCounter += 1 diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index 697c0fb6..e83fedc7 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 3611798738L +hashVal = 849017532 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 @@ -33,7 +33,7 @@ from toontown.friends.TrueFriendsMgr import TrueFriendsMgr from toontown.coghq.InGameEditorDCImports import * from toontown.friends import TTPlayerFriendsManager, TTUFriendsManager from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog -from otp.distributed import Account, DistributedDistrict, DistributedDirectory +from otp.distributed import Account, DistributedDistrict from toontown.estate import DistributedCannon, DistributedTarget, EstateManager, DistributedEstate, DistributedHouse, DistributedHouseInterior, DistributedGarden, DistributedHouseDoor, DistributedMailbox, DistributedFurnitureManager, DistributedFurnitureItem, DistributedBank, DistributedCloset, DistributedTrunk, DistributedPhone, DistributedFireworksCannon, DistributedLawnDecor, DistributedGardenPlot, DistributedGardenBox, DistributedFlower, DistributedGagTree, DistributedStatuary, DistributedToonStatuary, DistributedChangingStatuary, DistributedAnimatedStatuary, DistributedPlantBase, DistributedLawnDecor from toontown.toon import DistributedToon, DistributedNPCToonBase, DistributedNPCToon, DistributedSmartNPC, DistributedSmartNPC, DistributedNPCSpecialQuestGiver, DistributedNPCFlippyInToonHall, DistributedNPCScientist, DistributedNPCClerk, DistributedNPCTailor, DistributedNPCBlocker, DistributedNPCFisherman, DistributedNPCPartyPerson, DistributedNPCPetclerk, DistributedNPCKartClerk, DistributedNPCGlove from toontown.tutorial import DistributedBattleTutorial, TutorialManager diff --git a/otp/distributed/DistributedDirectory.py b/otp/distributed/DistributedDirectory.py deleted file mode 100644 index 4863db7e..00000000 --- a/otp/distributed/DistributedDirectory.py +++ /dev/null @@ -1,4 +0,0 @@ -from direct.distributed.DistributedObject import DistributedObject - -class DistributedDirectory(DistributedObject): - pass diff --git a/otp/distributed/DistributedDirectoryAI.py b/otp/distributed/DistributedDirectoryAI.py deleted file mode 100644 index e8f12f64..00000000 --- a/otp/distributed/DistributedDirectoryAI.py +++ /dev/null @@ -1,9 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectAI import DistributedObjectAI - -class DistributedDirectoryAI(DistributedObjectAI): - notify = DirectNotifyGlobal.directNotify.newCategory("DistributedDirectoryAI") - - def setParentingRules(self, todo0, todo1): - pass - diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index 35d2e395..4518798a 100644 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -940,7 +940,6 @@ class OTPClientRepository(ClientRepositoryBase): 'meta-h', 'meta-h-repeat', 'control-f9', - 'newDistributedDirectory', 'page_down', 'page_up', 'panda3d-render-error', @@ -953,7 +952,6 @@ class OTPClientRepository(ClientRepositoryBase): 'window-event', 'TCRSetZoneDone', 'aspectRatioChanged', - 'newDistributedDirectory', CConnectionRepository.getOverflowEventName(), self._getLostConnectionEvent(), 'render-texture-targets-changed', diff --git a/toontown/uberdog/ToontownUberRepository.py b/toontown/uberdog/ToontownUberRepository.py index 108680be..1f9222c5 100644 --- a/toontown/uberdog/ToontownUberRepository.py +++ b/toontown/uberdog/ToontownUberRepository.py @@ -1,7 +1,6 @@ from direct.distributed.PyDatagram import * import urlparse -from otp.distributed.DistributedDirectoryAI import DistributedDirectoryAI from otp.distributed.OtpDoGlobals import * from toontown.distributed.ToontownInternalRepository import ToontownInternalRepository import toontown.minigame.MinigameCreatorAI @@ -32,9 +31,6 @@ class ToontownUberRepository(ToontownInternalRepository): self.notify.setInfo(True) def handleConnected(self): - rootObj = DistributedDirectoryAI(self) - rootObj.generateWithRequiredAndId(self.getGameDoId(), 0, 0) - if config.GetBool('want-rpc-server', False): endpoint = config.GetString('rpc-server-endpoint', 'http://localhost:8080/') self.rpcServer = ToontownRPCServer(endpoint, ToontownRPCHandler(self))