diff --git a/etc/toon.dc b/etc/toon.dc index 894db19..d70682e 100755 --- a/etc/toon.dc +++ b/etc/toon.dc @@ -616,7 +616,6 @@ dclass DistributedToon : DistributedPlayer { setPartyStatus(uint64, uint8) ownrecv airecv; announcePartyStarted(uint64) ownrecv; setNeverStartedPartyRefunded(uint64, int8, uint16) ownrecv; - setModuleInfo(string []) airecv clsend; setDISLname(string) ram; setDISLid(uint32) ram db airecv; flagAv(uint32, uint16, string []) airecv ownsend; diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 44ce070..4023bf9 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -45,7 +45,6 @@ from toontown.toonbase import ToontownAccessAI from toontown.toonbase import TTLocalizer from toontown.catalog import CatalogAccessoryItem from toontown.minigame import MinigameCreatorAI -from . import ModuleListAI from functools import reduce if simbase.wantPets: from toontown.pets import PetLookerAI, PetObserve @@ -213,7 +212,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo self.hostedParties = [] self.partiesInvitedTo = [] self.partyReplyInfoBases = [] - self.modulelist = ModuleListAI.ModuleList() self._dbCheckDoLater = None return @@ -4194,31 +4192,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo else: self.air.writeServerEvent('suspicious', self.doId, '$ found in toon name') - def setModuleInfo(self, info): - avId = self.air.getAvatarIdFromSender() - key = 'outrageous' - self.moduleWhitelist = self.modulelist.loadWhitelistFile() - self.moduleBlacklist = self.modulelist.loadBlacklistFile() - for obfuscatedModule in info: - module = '' - p = 0 - for ch in obfuscatedModule: - ic = ord(ch) ^ ord(key[p]) - p += 1 - if p >= len(key): - p = 0 - module += chr(ic) - - if module not in self.moduleWhitelist: - if module in self.moduleBlacklist: - self.air.writeServerEvent('suspicious', avId, 'Black List module %s loaded into process.' % module) - if simbase.config.GetBool('want-ban-blacklist-module', False): - commentStr = 'User has blacklist module: %s attached to their game process' % module - dislId = self.DISLid - simbase.air.banManager.ban(self.doId, dislId, commentStr) - else: - self.air.writeServerEvent('suspicious', avId, 'Unknown module %s loaded into process.' % module) - def teleportResponseToAI(self, toAvId, available, shardId, hoodId, zoneId, fromAvId): if not self.WantTpTrack: return diff --git a/toontown/toon/ModuleListAI.py b/toontown/toon/ModuleListAI.py deleted file mode 100644 index 51dd360..0000000 --- a/toontown/toon/ModuleListAI.py +++ /dev/null @@ -1,99 +0,0 @@ -import os - -class ModuleList: - serverDataFolder = simbase.config.GetString('server-data-folder', '') - - def __init__(self): - self.moduleWhitelistFilename = self.getWhitelistFilename() - self.moduleBlacklistFilename = self.getBlacklistFilename() - self.loadBlacklistFile() - self.loadWhitelistFile() - - def getWhitelistFilename(self): - result = '%s.moduleWhiteList' % self.serverDataFolder - return result - - def getBlacklistFilename(self): - result = '%s.moduleBlackList' % self.serverDataFolder - return result - - def loadBlacklistFile(self): - try: - file = open(self.moduleBlacklistFilename + '.bu', 'r') - if os.path.exists(self.moduleBlacklistFilename): - os.remove(self.moduleBlacklistFilename) - except IOError: - try: - file = open(self.moduleBlacklistFilename, 'r') - except IOError: - return set() - - file.seek(0) - moduleFile = self.loadFrom(file) - file.close() - result = self.loadFrom(moduleFile) - self.moduleBlacklist = result - return result - - def loadWhitelistFile(self): - try: - file = open(self.moduleWhitelistFilename + '.bu', 'r') - if os.path.exists(self.moduleWhitelistFilename): - os.remove(self.moduleWhitelistFilename) - except IOError: - try: - file = open(self.moduleWhitelistFilename, 'r') - except IOError: - return set() - - file.seek(0) - moduleFile = self.loadFrom(file) - file.close() - result = self.loadFrom(moduleFile) - self.moduleWhitelist = result - return result - - def loadFrom(self, file): - result = set() - try: - for module in file: - module = module.strip() - if module: - result.add(module) - - except EOFError: - pass - - return result - - def updateWhitelistFile(self): - try: - backup = self.getWhitelistFilename() + '.bu' - if os.path.exists(self.getWhitelistFilename()): - os.rename(self.getWhitelistFilename(), backup) - file = open(self.getWhitelistFilename(), 'w') - file.seek(0) - for whiteModule in self.moduleWhitelist: - file.write(whiteModule + '\n') - - file.close() - if os.path.exists(backup): - os.remove(backup) - except EnvironmentError: - self.notify.warning(str(sys.exc_info()[1])) - - def updateBlacklistFile(self): - try: - backup = self.getBlacklistFilename() + '.bu' - if os.path.exists(self.getBlacklistFilename()): - os.rename(self.getBlacklistFilename(), backup) - file = open(self.getBlacklistFilename(), 'w') - file.seek(0) - for blackModule in self.moduleBlacklist: - file.write(blackModule + '\n') - - file.close() - if os.path.exists(backup): - os.remove(backup) - except EnvironmentError: - self.notify.warning(str(sys.exc_info()[1])) diff --git a/toontown/toonbase/ToonBase.py b/toontown/toonbase/ToonBase.py index 6112c35..b76cb97 100644 --- a/toontown/toonbase/ToonBase.py +++ b/toontown/toonbase/ToonBase.py @@ -335,7 +335,6 @@ class ToonBase(OTPBase.OTPBase): cr.loginFSM.request('connect', [serverList]) self.ttAccess = ToontownAccess.ToontownAccess() - self.ttAccess.initModuleInfo() def removeGlitchMessage(self): self.ignore('InputState-forward') @@ -367,8 +366,6 @@ class ToonBase(OTPBase.OTPBase): except: pass - if hasattr(self, 'ttAccess'): - self.ttAccess.delete() if self.cr.timeManager: self.cr.timeManager.setDisconnectReason(ToontownGlobals.DisconnectCloseWindow) base.cr._userLoggingOut = False diff --git a/toontown/toonbase/ToontownAccess.py b/toontown/toonbase/ToontownAccess.py index 147e8af..f36a066 100644 --- a/toontown/toonbase/ToontownAccess.py +++ b/toontown/toonbase/ToontownAccess.py @@ -1,44 +1,8 @@ -#from pandac.PandaModules import listProcessModules -from direct.task import Task from toontown.hood import ZoneUtil from toontown.toonbase import ToontownGlobals class ToontownAccess: - def __init__(self): - self.startupModules = [] - - def initModuleInfo(self): - self.startupModules = self.getModuleList() - taskMgr.doMethodLater(300, self.checkModuleInfo, 'moduleListTask') - - def delete(self): - taskMgr.remove('moduleListTask') - del self.startupModules - - def checkModuleInfo(self, task): - currentModuleList = self.getModuleList() - newModules = [] - for module in currentModuleList: - if module not in self.startupModules: - self.startupModules.insert(0, module) - newModules.insert(0, module) - - self.sendUpdate('setModuleInfo', [newModules]) - return task.again - - def getModuleList(self): - moduleString = '' #listProcessModules() - moduleList = [] - if moduleString: - moduleList = moduleString.split(',') - return moduleList - - def sendUpdate(self, fieldName, args = [], sendToId = None): - if base.cr and hasattr(base, 'localAvatar'): - dg = base.localAvatar.dclass.clientFormatUpdate(fieldName, sendToId or base.localAvatar.doId, args) - base.cr.send(dg) - def canAccess(self, zoneId = None): if base.cr.isPaid(): return True