diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index baf4b1ed..c8070b36 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -559,15 +559,12 @@ struct datetime { dclass ToontownDistrict : DistributedDistrict { setParentingRules(string, string) broadcast ram; - allowAHNNLog(bool) broadcast required ram; }; dclass ToontownDistrictStats : DistributedObject { settoontownDistrictId(uint32) broadcast required ram; setAvatarCount(uint32) broadcast required ram; - setNewAvatarCount(uint32) broadcast required ram; setInvasionStatus(uint8) broadcast required ram; - setStats : setAvatarCount, setNewAvatarCount; }; dclass DistributedAnimatedProp : DistributedObject { diff --git a/otp/avatar/AvatarDNA.py b/otp/avatar/AvatarDNA.py deleted file mode 100755 index 3cb9fa4b..00000000 --- a/otp/avatar/AvatarDNA.py +++ /dev/null @@ -1,21 +0,0 @@ -from pandac.PandaModules import * -from direct.directnotify.DirectNotifyGlobal import * -import random -from direct.distributed.PyDatagram import PyDatagram -from direct.distributed.PyDatagramIterator import PyDatagramIterator -notify = directNotify.newCategory('AvatarDNA') - -class AvatarDNA: - - def __str__(self): - return 'avatar parent class: type undefined' - - def makeNetString(self): - notify.error('called makeNetString on avatarDNA parent class') - - def makeFromNetString(self, string): - notify.error('called makeFromNetString on avatarDNA parent class') - - def getType(self): - notify.error('Invalid DNA type: ', self.type) - return type diff --git a/otp/avatar/DistributedAvatar.py b/otp/avatar/DistributedAvatar.py index 07f2f244..248128b4 100755 --- a/otp/avatar/DistributedAvatar.py +++ b/otp/avatar/DistributedAvatar.py @@ -333,4 +333,4 @@ def getPos(): """ Return your target's position. """ - return spellbook.getTarget().getPos() + return spellbook.getTarget().getPos() \ No newline at end of file diff --git a/otp/avatar/DistributedAvatarAI.py b/otp/avatar/DistributedAvatarAI.py index 6e5bb179..a525792a 100755 --- a/otp/avatar/DistributedAvatarAI.py +++ b/otp/avatar/DistributedAvatarAI.py @@ -1,9 +1,6 @@ from otp.ai.AIBaseGlobal import * from otp.otpbase import OTPGlobals -from direct.fsm import ClassicFSM -from direct.fsm import State from direct.distributed import DistributedNodeAI -from direct.task import Task class DistributedAvatarAI(DistributedNodeAI.DistributedNodeAI): @@ -51,32 +48,6 @@ class DistributedAvatarAI(DistributedNodeAI.DistributedNodeAI): def getHp(self): return self.hp - def b_setLocationName(self, locationName): - self.d_setLocationName(locationName) - self.setLocationName(locationName) - - def d_setLocationName(self, locationName): - pass - - def setLocationName(self, locationName): - self.locationName = locationName - - def getLocationName(self): - return self.locationName - - def b_setActivity(self, activity): - self.d_setActivity(activity) - self.setActivity(activity) - - def d_setActivity(self, activity): - pass - - def setActivity(self, activity): - self.activity = activity - - def getActivity(self): - return self.activity - def toonUp(self, num): if self.hp >= self.maxHp: return @@ -98,4 +69,4 @@ class DistributedAvatarAI(DistributedNodeAI.DistributedNodeAI): senderId = self.air.getAvatarIdFromSender() self.air.writeServerEvent('Admin chat warning', senderId, 'using setParentStr to send "%s"' % parentToken) self.notify.warning('Admin chat warning: %s using setParentStr to send "%s"' % (senderId, parentToken)) - DistributedNodeAI.DistributedNodeAI.setParentStr(self, parentToken) + DistributedNodeAI.DistributedNodeAI.setParentStr(self, parentToken) \ No newline at end of file diff --git a/otp/avatar/DistributedAvatarUD.py b/otp/avatar/DistributedAvatarUD.py index 00c3c441..1c6d4403 100755 --- a/otp/avatar/DistributedAvatarUD.py +++ b/otp/avatar/DistributedAvatarUD.py @@ -14,5 +14,4 @@ class DistributedAvatarUD(DistributedObjectUD): pass def confirmAvOnShard(self, todo0, todo1): - pass - + pass \ No newline at end of file diff --git a/otp/distributed/DistributedDistrict.py b/otp/distributed/DistributedDistrict.py index 560ae390..f6475923 100755 --- a/otp/distributed/DistributedDistrict.py +++ b/otp/distributed/DistributedDistrict.py @@ -10,7 +10,6 @@ class DistributedDistrict(DistributedObject): self.name = 'NotGiven' self.available = 0 self.avatarCount = 0 - self.newAvatarCount = 0 def announceGenerate(self): DistributedObject.announceGenerate(self) @@ -24,7 +23,6 @@ class DistributedDistrict(DistributedObject): del self.cr.activeDistrictMap[self.doId] DistributedObject.delete(self) messenger.send('shardInfoUpdated') - return def setAvailable(self, available): self.available = available @@ -32,4 +30,4 @@ class DistributedDistrict(DistributedObject): def setName(self, name): self.name = name - messenger.send('shardInfoUpdated') + messenger.send('shardInfoUpdated') \ No newline at end of file diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index e2888609..2e2bc525 100755 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -1077,10 +1077,10 @@ class OTPClientRepository(ClientRepositoryBase): def listActiveShards(self): list = [] + for s in self.activeDistrictMap.values(): if s.available: - list.append((s.doId, s.name, s.avatarCount, s.newAvatarCount, - s.invasionStatus)) + list.append((s.doId, s.name, s.avatarCount, s.invasionStatus)) return list diff --git a/otp/movement/CMover.py b/otp/movement/CMover.py deleted file mode 100755 index c450b542..00000000 --- a/otp/movement/CMover.py +++ /dev/null @@ -1,9 +0,0 @@ -from pandac.PandaModules import * - -class CMover: - - def __init__(self, objNodePath, fwdSpeed=1, rotSpeed=1): - self.objNodePath = objNodePath - self.fwdSpeed = fwdSpeed - self.rotSpeed = rotSpeed - \ No newline at end of file diff --git a/otp/movement/Impulse.py b/otp/movement/Impulse.py deleted file mode 100755 index d03c3204..00000000 --- a/otp/movement/Impulse.py +++ /dev/null @@ -1,29 +0,0 @@ -from pandac.PandaModules import * -from direct.showbase import DirectObject - -class Impulse(DirectObject.DirectObject): - - def __init__(self): - self.mover = None - self.nodePath = None - return - - def destroy(self): - pass - - def _process(self, dt): - pass - - def _setMover(self, mover): - self.mover = mover - self.nodePath = self.mover.getNodePath() - self.VecType = self.mover.VecType - - def _clearMover(self, mover): - if self.mover == mover: - self.mover = None - self.nodePath = None - return - - def isCpp(self): - return 0 diff --git a/otp/movement/Mover.py b/otp/movement/Mover.py deleted file mode 100755 index 219d4210..00000000 --- a/otp/movement/Mover.py +++ /dev/null @@ -1,76 +0,0 @@ -from pandac.PandaModules import * -from CMover import CMover -from direct.directnotify import DirectNotifyGlobal -from otp.movement.PyVec3 import PyVec3 -from direct.showbase import PythonUtil -import __builtin__ - -class Mover: - notify = DirectNotifyGlobal.directNotify.newCategory('Mover') - SerialNum = 0 - Profile = 0 - Pstats = 1 - PSCCpp = 'App:Show code:moveObjects:MoverC++' - PSCPy = 'App:Show code:moveObjects:MoverPy' - PSCInt = 'App:Show code:moveObjects:MoverIntegrate' - - def __init__(self, objNodePath, fwdSpeed = 1, rotSpeed = 1): - CMover.__init__(self, objNodePath, fwdSpeed, rotSpeed) - self.serialNum = Mover.SerialNum - Mover.SerialNum += 1 - self.VecType = Vec3 - self.impulses = {} - if Mover.Pstats: - self.pscCpp = PStatCollector(Mover.PSCCpp) - self.pscPy = PStatCollector(Mover.PSCPy) - self.pscInt = PStatCollector(Mover.PSCInt) - - def destroy(self): - for name, impulse in self.impulses.items(): - Mover.notify.debug('removing impulse: %s' % name) - self.removeImpulse(name) - - def addImpulse(self, name, impulse): - if impulse.isCpp(): - CMover.addCImpulse(self, name, impulse) - else: - self.impulses[name] = impulse - impulse._setMover(self) - - def removeImpulse(self, name): - if name not in self.impulses: - if not CMover.removeCImpulse(self, name): - Mover.notify.warning("Mover.removeImpulse: unknown impulse '%s'" % name) - return - self.impulses[name]._clearMover(self) - del self.impulses[name] - - def getCollisionEventName(self): - return 'moverCollision-%s' % self.serialNum - - def move(self, dt = -1, profile = 0): - if Mover.Profile and not profile: - - def func(doMove = self.move): - for i in xrange(10000): - doMove(dt, profile=1) - - __builtin__.func = func - PythonUtil.startProfile(cmd='func()', filename='profile', sorts=['cumulative'], callInfo=0) - del __builtin__.func - return - if Mover.Pstats: - self.pscCpp.start() - CMover.processCImpulses(self, dt) - if Mover.Pstats: - self.pscCpp.stop() - self.pscPy.start() - for impulse in self.impulses.values(): - impulse._process(self.getDt()) - - if Mover.Pstats: - self.pscPy.stop() - self.pscInt.start() - CMover.integrate(self) - if Mover.Pstats: - self.pscInt.stop() diff --git a/otp/movement/PyVec3.py b/otp/movement/PyVec3.py deleted file mode 100755 index 8de94192..00000000 --- a/otp/movement/PyVec3.py +++ /dev/null @@ -1,175 +0,0 @@ -from pandac.PandaModules import * -import types -import math - -class PyVec3: - Epsilon = 0.0001 - ScalarTypes = (types.FloatType, types.IntType, types.LongType) - - def __init__(self, *args): - self.assign(*args) - - def assign(self, *args): - if len(args) == 1: - arg = args[0] - if type(arg) in PyVec3.ScalarTypes: - x = y = z = arg - elif isinstance(arg, self.__class__): - x = arg.x - y = arg.y - z = arg.z - elif isinstance(arg, VBase3): - x = arg.getX() - y = arg.getY() - z = arg.getZ() - else: - raise TypeError - elif len(args) == 3: - x = args[0] - y = args[1] - z = args[2] - self.x = x - self.y = y - self.z = z - - def getX(self): - return self.x - - def getY(self): - return self.y - - def getZ(self): - return self.z - - def setX(self, x): - self.x = x - - def setY(self, y): - self.y = y - - def setZ(self, z): - self.z = z - - def set(self, x, y, z): - self.x = x - self.y = y - self.z = z - - def fill(self, s): - self.x = self.y = self.z = s - - def length(self): - return math.sqrt(self.x * self.x + self.y * self.y + self.z * self.z) - - def lengthSquared(self): - return self.x * self.x + self.y * self.y + self.z * self.z - - def normalize(self): - self /= self.length() - - def dot(self, other): - return self.x * other.getX() + self.y * other.getY() + self.z * other.getZ() - - def _crossResults(self, other): - return (self.y * other.getZ() - self.z * other.getY(), self.z * other.getX() - self.x * other.getZ(), self.x * other.getY() - self.y * other.getX()) - - def cross(self, other): - return PyVec3(*self._crossResults(other)) - - def crossInto(self, other): - self.x, self.y, self.z = self._crossResults(other) - - def __lt__(a, b): - return a.length() < b.length() - - def __le__(a, b): - return a < b or a == b - - def __eq__(a, b): - return abs(a.length() - b.length()) < PyVec3.Epsilon - - def __ne__(a, b): - return not a == b - - def __ge__(a, b): - return a > b or a == b - - def __gt__(a, b): - return a.length() > b.length() - - def __add__(a, b): - return PyVec3(a.getX() + b.getX(), a.getY() + b.getY(), a.getZ() + b.getZ()) - - def __sub__(a, b): - return PyVec3(a.getX() - b.getX(), a.getY() - b.getY(), a.getZ() - b.getZ()) - - def __mul__(a, s): - return PyVec3(a.getX() * s, a.getY() * s, a.getZ() * s) - - def __div__(a, s): - return PyVec3(a.getX() / s, a.getY() / s, a.getZ() / s) - - def __iadd__(self, other): - self.x += other.getX() - self.y += other.getY() - self.z += other.getZ() - return self - - def __isub__(self, other): - self.x -= other.getX() - self.y -= other.getY() - self.z -= other.getZ() - return self - - def __imul__(self, s): - self.x *= s - self.y *= s - self.z *= s - return self - - def __idiv__(self, s): - self.x /= s - self.y /= s - self.z /= s - return self - - def addX(self, s): - self.x += s - - def addY(self, s): - self.y += s - - def addZ(self, s): - self.z += s - - def eq(self, other): - return self == other - - def lessThan(self, other): - return self < other - - def ne(self, other): - return self != other - - def __getitem__(self, i): - if i == 0: - return self.x - elif i == 1: - return self.y - elif i == 2: - return self.z - else: - raise IndexError - - def __setitem__(self, i, s): - if i == 0: - self.x = s - elif i == 1: - self.y = s - elif i == 2: - self.z = s - else: - raise IndexError - - def __repr__(self): - return 'PyVec3(%s,%s,%s)' % (self.x, self.y, self.z) diff --git a/otp/movement/__init__.py b/otp/movement/__init__.py deleted file mode 100755 index e69de29b..00000000 diff --git a/otp/otpbase/OTPBase.py b/otp/otpbase/OTPBase.py index 2e7d7c87..be60d0b2 100755 --- a/otp/otpbase/OTPBase.py +++ b/otp/otpbase/OTPBase.py @@ -13,13 +13,11 @@ class OTPBase(ShowBase): if not self.idTags: del self.idTags self.wantNametags = self.config.GetBool('want-nametags', 1) - self.fillShardsToIdealPop = self.config.GetBool('fill-shards-to-ideal-pop', 1) self.wantDynamicShadows = 1 self.stereoEnabled = False self.enviroDR = None self.enviroCam = None self.pixelZoomSetup = False - self.gameOptionsCode = '' self.whiteList = None if config.GetBool('want-whitelist', True): @@ -35,7 +33,6 @@ class OTPBase(ShowBase): else: base.cam.node().setCameraMask(OTPRender.MainCameraBitmask | OTPRender.EnviroCameraBitmask) taskMgr.setupTaskChain('net') - return def setTaskChainNetThreaded(self): if base.config.GetBool('want-threaded-network', 0): diff --git a/toontown/distributed/ToontownDistrict.py b/toontown/distributed/ToontownDistrict.py index 7d3b253b..5f97a3a7 100755 --- a/toontown/distributed/ToontownDistrict.py +++ b/toontown/distributed/ToontownDistrict.py @@ -8,12 +8,5 @@ class ToontownDistrict(DistributedDistrict.DistributedDistrict): def __init__(self, cr): DistributedDistrict.DistributedDistrict.__init__(self, cr) self.avatarCount = 0 - self.newAvatarCount = 0 self.invasionStatus = 0 - self.suitStatus = '' - - def allowAHNNLog(self, allow): - self.allowAHNN = allow - - def getAllowAHNNLog(self): - return self.allowAHNN + self.suitStatus = '' \ No newline at end of file diff --git a/toontown/distributed/ToontownDistrictAI.py b/toontown/distributed/ToontownDistrictAI.py index 9c7ccf0f..b12851e8 100755 --- a/toontown/distributed/ToontownDistrictAI.py +++ b/toontown/distributed/ToontownDistrictAI.py @@ -1,14 +1,10 @@ from direct.directnotify.DirectNotifyGlobal import directNotify -import time - from otp.distributed.DistributedDistrictAI import DistributedDistrictAI - +import time class ToontownDistrictAI(DistributedDistrictAI): notify = directNotify.newCategory('ToontownDistrictAI') - created = 0 - ahnnLog = 0 def announceGenerate(self): DistributedDistrictAI.announceGenerate(self) @@ -42,19 +38,6 @@ class ToontownDistrictAI(DistributedDistrictAI): } self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status]) - def allowAHNNLog(self, ahnnLog): - self.ahnnLog = ahnnLog - - def d_allowAHNNLog(self, ahnnLog): - self.sendUpdate('allowAHNNLog', [ahnnLog]) - - def b_allowAHNNLog(self, ahnnLog): - self.allowAHNNLog(ahnnLog) - self.d_allowAHNNLog(ahnnLog) - - def getAllowAHNNLog(self): - return self.ahnnLog - def setName(self, name): DistributedDistrictAI.setName(self, name) @@ -67,4 +50,4 @@ class ToontownDistrictAI(DistributedDistrictAI): # Send a shard status update containing our availability: status = {'available': bool(available)} - self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status]) + self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status]) \ No newline at end of file diff --git a/toontown/distributed/ToontownDistrictStats.py b/toontown/distributed/ToontownDistrictStats.py index ee6bbaae..8cf519f1 100755 --- a/toontown/distributed/ToontownDistrictStats.py +++ b/toontown/distributed/ToontownDistrictStats.py @@ -76,14 +76,6 @@ class ToontownDistrictStats(DistributedObject.DistributedObject): if self.toontownDistrictId in self.cr.activeDistrictMap: self.cr.activeDistrictMap[self.toontownDistrictId].avatarCount = avatarCount - def setNewAvatarCount(self, newAvatarCount): - if self.toontownDistrictId in self.cr.activeDistrictMap: - self.cr.activeDistrictMap[self.toontownDistrictId].newAvatarCount = newAvatarCount - def setInvasionStatus(self, invasionStatus): if self.toontownDistrictId in self.cr.activeDistrictMap: - self.cr.activeDistrictMap[self.toontownDistrictId].invasionStatus = invasionStatus - - def setStats(self, avatarCount, newAvatarCount): - self.setAvatarCount(avatarCount) - self.setNewAvatarCount(newAvatarCount) + self.cr.activeDistrictMap[self.toontownDistrictId].invasionStatus = invasionStatus \ No newline at end of file diff --git a/toontown/distributed/ToontownDistrictStatsAI.py b/toontown/distributed/ToontownDistrictStatsAI.py index 843a4971..0364cc43 100755 --- a/toontown/distributed/ToontownDistrictStatsAI.py +++ b/toontown/distributed/ToontownDistrictStatsAI.py @@ -6,7 +6,6 @@ class ToontownDistrictStatsAI(DistributedObjectAI): districtId = 0 avatarCount = 0 - newAvatarCount = 0 invasionStatus = 0 def announceGenerate(self): @@ -51,19 +50,6 @@ class ToontownDistrictStatsAI(DistributedObjectAI): def getAvatarCount(self): return self.avatarCount - def setNewAvatarCount(self, newAvatarCount): - self.newAvatarCount = newAvatarCount - - def d_setNewAvatarCount(self, newAvatarCount): - self.sendUpdate('setNewAvatarCount', [newAvatarCount]) - - def b_setNewAvatarCount(self, newAvatarCount): - self.setNewAvatarCount(newAvatarCount) - self.d_setNewAvatarCount(newAvatarCount) - - def getNewAvatarCount(self): - return self.newAvatarCount - def setInvasionStatus(self, invasionStatus): self.invasionStatus = invasionStatus @@ -75,4 +61,4 @@ class ToontownDistrictStatsAI(DistributedObjectAI): self.d_setInvasionStatus(invasionStatus) def getInvasionStatus(self): - return self.invasionStatus + return self.invasionStatus \ No newline at end of file diff --git a/toontown/shtiker/ShardPage.py b/toontown/shtiker/ShardPage.py index 305c5f74..6725123d 100755 --- a/toontown/shtiker/ShardPage.py +++ b/toontown/shtiker/ShardPage.py @@ -117,7 +117,7 @@ class ShardPage(ShtikerPage.ShtikerPage): curShardTuples.sort(compareShardTuples) actualShardId = base.localAvatar.defaultShard for i in xrange(len(curShardTuples)): - shardId, name, pop, WVPop, invasionStatus = curShardTuples[i] + shardId, name, pop, invasionStatus = curShardTuples[i] if shardId == actualShardId: self.currentBTP = buttonTuple[0] self.currentBTL = buttonTuple[1] @@ -478,19 +478,17 @@ class ShardPage(ShtikerPage.ShtikerPage): actualShardName = None anyChanges = 0 totalPop = 0 - totalWVPop = 0 currentMap = {} self.shardButtons = [] for i in xrange(len(curShardTuples)): - shardId, name, pop, WVPop, invasionStatus = curShardTuples[i] + shardId, name, pop, invasionStatus = curShardTuples[i] if shardId == actualShardId: actualShardName = name totalPop += pop - totalWVPop += WVPop currentMap[shardId] = 1 buttonTuple = self.shardButtonMap.get(shardId) diff --git a/toontown/suit/SuitDNA.py b/toontown/suit/SuitDNA.py index e71cd328..98f4650c 100755 --- a/toontown/suit/SuitDNA.py +++ b/toontown/suit/SuitDNA.py @@ -5,7 +5,6 @@ from toontown.toonbase import TTLocalizer, ToontownGlobals import random from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator -from otp.avatar import AvatarDNA notify = directNotify.newCategory('SuitDNA') suitHeadTypes = ['f', 'p', @@ -171,7 +170,7 @@ def getSuitsInDept(dept): end = start + suitsPerDept return suitHeadTypes[start:end] -class SuitDNA(AvatarDNA.AvatarDNA): +class SuitDNA: def __init__(self, str = None, type = None, dna = None, r = None, b = None, g = None): if str != None: diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index 8f7a24e6..5247e683 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -4884,10 +4884,6 @@ def getZone(): zone = invoker.zoneId return 'ZoneID: %s' % (zone) -@magicWord(category=CATEGORY_PROGRAMMER) -def getPos(): - return 'Pos: %s' % spellbook.getInvoker().getPos() - @magicWord(category=CATEGORY_MODERATOR, types=[int]) def nametagStyle(nametagStyle): currentAccess = spellbook.getInvokerAccess() diff --git a/toontown/toon/ToonDNA.py b/toontown/toon/ToonDNA.py index e697fd22..f3680908 100755 --- a/toontown/toon/ToonDNA.py +++ b/toontown/toon/ToonDNA.py @@ -3,7 +3,6 @@ from pandac.PandaModules import * from direct.directnotify.DirectNotifyGlobal import * from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator -from otp.avatar import AvatarDNA notify = directNotify.newCategory('ToonDNA') mergeMATTailor = config.GetBool('want-mat-all-tailors', 0) toonSpeciesTypes = ['d', @@ -2436,7 +2435,7 @@ def isValidAccessory(itemIdx, textureIdx, colorIdx, which): return False -class ToonDNA(AvatarDNA.AvatarDNA): +class ToonDNA: def __init__(self, str = None, type = None, dna = None, r = None, b = None, g = None): if str != None: diff --git a/toontown/toon/ToonTeleportPanel.py b/toontown/toon/ToonTeleportPanel.py index 4f930fb6..f4ba0df4 100755 --- a/toontown/toon/ToonTeleportPanel.py +++ b/toontown/toon/ToonTeleportPanel.py @@ -212,7 +212,6 @@ class ToonTeleportPanel(DirectFrame): self.shardId = shardId self.hoodId = hoodId self.zoneId = zoneId - return def exitOtherShard(self): self.bYes.hide()