Remove SettingsMgr - Unused.

This commit is contained in:
Daniel 2015-03-04 17:02:26 +02:00
parent 114c48d492
commit d69e7550d5
7 changed files with 1 additions and 138 deletions

View file

@ -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);

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file