From d69e7550d55747dd5d1db5e293ff9a67827123e8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Mar 2015 17:02:26 +0200 Subject: [PATCH] Remove SettingsMgr - Unused. --- astron/dclass/otp.dc | 6 --- otp/distributed/DCClassImports.py | 3 +- otp/web/SettingsMgr.py | 41 ------------------- otp/web/SettingsMgrAI.py | 12 ------ otp/web/SettingsMgrBase.py | 65 ------------------------------- otp/web/SettingsMgrUD.py | 12 ------ otp/web/__init__.py | 0 7 files changed, 1 insertion(+), 138 deletions(-) delete mode 100644 otp/web/SettingsMgr.py delete mode 100644 otp/web/SettingsMgrAI.py delete mode 100644 otp/web/SettingsMgrBase.py delete mode 100644 otp/web/SettingsMgrUD.py delete mode 100644 otp/web/__init__.py diff --git a/astron/dclass/otp.dc b/astron/dclass/otp.dc index 52701b0b..7c42f145 100644 --- a/astron/dclass/otp.dc +++ b/astron/dclass/otp.dc @@ -24,7 +24,6 @@ from otp.uberdog import OtpAvatarManager/AI/UD from otp.chat import ChatAgent/UD from otp.uberdog import SpeedchatRelay/UD from otp.distributed import CentralLogger/AI/UD -from otp.web import SettingsMgr/AI/UD from otp.status import StatusDatabase/UD from otp.avatar import AvatarHandle @@ -482,11 +481,6 @@ dclass CentralLogger : DistributedObject { logAIGarbage() airecv; }; -dclass SettingsMgr : DistributedObject { - requestAllChangedSettings() airecv clsend; - settingChange(string, string) airecv; -}; - dclass StatusDatabase : DistributedObject { requestOfflineAvatarStatus(uint32 []) airecv clsend; recvOfflineAvatarStatus(uint32, uint32); diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index feba0418..4ec53c3c 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 580988815 +hashVal = 2077456799 from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog @@ -16,7 +16,6 @@ from toontown.shtiker import DeleteManager, PurchaseManager, NewbiePurchaseManag from toontown.pets import DistributedPetProxy from toontown.uberdog.ClientServicesManager import ClientServicesManager from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedPolarBearMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedSillyMeterMgr -from otp.web import SettingsMgr from toontown.ai.DistributedTrashcanZeroMgr import DistributedTrashcanZeroMgr from toontown.uberdog.DistributedMailManager import DistributedMailManager from otp.chat import ChatAgent diff --git a/otp/web/SettingsMgr.py b/otp/web/SettingsMgr.py deleted file mode 100644 index 18ff3c77..00000000 --- a/otp/web/SettingsMgr.py +++ /dev/null @@ -1,41 +0,0 @@ -from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal -from direct.directnotify.DirectNotifyGlobal import directNotify -from otp.web.SettingsMgrBase import SettingsMgrBase - -class SettingsMgr(DistributedObjectGlobal, SettingsMgrBase): - notify = directNotify.newCategory('SettingsMgr') - - def announceGenerate(self): - DistributedObjectGlobal.announceGenerate(self) - SettingsMgrBase.announceGenerate(self) - if not self.cr.isLive(): - self._sracs = None - if self.cr.isConnected(): - self._scheduleChangedSettingRequest() - self._crConnectEvent = self.cr.getConnectedEvent() - self.accept(self._crConnectEvent, self._handleConnected) - return - - def _handleConnected(self): - self._scheduleChangedSettingRequest() - - def _scheduleChangedSettingRequest(self): - if self._sracs: - self._sracs.destroy() - self._sracs = FrameDelayedCall('requestAllChangedSettings', self.sendRequestAllChangedSettings) - - def delete(self): - self.ignore(self._crConnectEvent) - if self._sracs: - self._sracs.destroy() - SettingsMgrBase.delete(self) - DistributedObjectGlobal.delete(self) - - def sendRequestAllChangedSettings(self): - self.sendUpdate('requestAllChangedSettings', []) - - def settingChange(self, settingName, valueStr): - if valueStr == self._getCurrentValueRepr(settingName): - return - self.notify.info('got setting change: %s -> %s' % (settingName, valueStr)) - self._changeSetting(settingName, valueStr) diff --git a/otp/web/SettingsMgrAI.py b/otp/web/SettingsMgrAI.py deleted file mode 100644 index 19ebd98b..00000000 --- a/otp/web/SettingsMgrAI.py +++ /dev/null @@ -1,12 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectAI import DistributedObjectAI - -class SettingsMgrAI(DistributedObjectAI): - notify = DirectNotifyGlobal.directNotify.newCategory("SettingsMgrAI") - - def requestAllChangedSettings(self): - pass - - def settingChange(self, todo0, todo1): - pass - diff --git a/otp/web/SettingsMgrBase.py b/otp/web/SettingsMgrBase.py deleted file mode 100644 index 6e2004c9..00000000 --- a/otp/web/SettingsMgrBase.py +++ /dev/null @@ -1,65 +0,0 @@ -from direct.directnotify.DirectNotifyGlobal import directNotify - -class SettingsMgrBase: - notify = directNotify.newCategory('SettingsMgrBase') - - def announceGenerate(self): - self._settings = {} - self._originalValueReprs = {} - self._currentValueReprs = {} - self._initSettings() - - def delete(self): - del self._settings - - def _initSettings(self): - pass - - def _iterSettingNames(self): - for name in self._settings.iterkeys(): - yield name - - def _addSettings(self, *settings): - for setting in settings: - self._addSetting(setting) - - def _addSetting(self, setting): - name = setting.getName() - if name in self._settings: - self.notify.error('duplicate setting "%s"' % name) - self._settings[name] = setting - self._originalValueReprs[name] = repr(setting.getValue()) - self._currentValueReprs[name] = repr(setting.getValue()) - - def _getOriginalValueRepr(self, settingName): - return self._originalValueReprs.get(settingName) - - def _getCurrentValueRepr(self, settingName): - return self._currentValueReprs.get(settingName) - - def _removeSetting(self, setting): - del self._settings[setting.getName()] - del self._originalValueReprs[setting.getName()] - del self._currentValueReprs[setting.getName()] - - def _getSetting(self, settingName): - return self._settings[settingName] - - def _isSettingModified(self, settingName): - return self._getOriginalValueRepr(settingName) != self._getCurrentValueRepr(settingName) - - def _changeSetting(self, settingName, valueStr): - try: - val = eval(valueStr) - except: - self.notify.warning('error evaling "%s" for setting "%s"' % (valueStr, settingName)) - return - - try: - setting = self._getSetting(settingName) - except: - self.notify.warning('unknown setting %s' % settingName) - return - - setting.setValue(val) - self._currentValueReprs[settingName] = valueStr diff --git a/otp/web/SettingsMgrUD.py b/otp/web/SettingsMgrUD.py deleted file mode 100644 index 57330dea..00000000 --- a/otp/web/SettingsMgrUD.py +++ /dev/null @@ -1,12 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectUD import DistributedObjectUD - -class SettingsMgrUD(DistributedObjectUD): - notify = DirectNotifyGlobal.directNotify.newCategory("SettingsMgrUD") - - def requestAllChangedSettings(self): - pass - - def settingChange(self, todo0, todo1): - pass - diff --git a/otp/web/__init__.py b/otp/web/__init__.py deleted file mode 100644 index e69de29b..00000000