From e4340eb131524ac251f690e49bcb307ba2551edd Mon Sep 17 00:00:00 2001 From: John Date: Mon, 29 Jun 2015 21:54:28 +0300 Subject: [PATCH] Stuff that was bothering me --- dependencies/astron/dclass/stride.dc | 42 +++++++++---------- otp/ai/BanManagerAI.py | 2 - toontown/ai/ToontownAIRepository.py | 2 +- toontown/distributed/ToontownDistrictStats.py | 14 +++---- .../distributed/ToontownDistrictStatsAI.py | 14 +++---- toontown/minigame/DistributedTwoDGame.py | 2 - toontown/toon/DistributedToon.py | 3 -- toontown/toon/DistributedToonAI.py | 7 ---- toontown/toon/DistributedToonUD.py | 3 -- 9 files changed, 35 insertions(+), 54 deletions(-) diff --git a/dependencies/astron/dclass/stride.dc b/dependencies/astron/dclass/stride.dc index 4442f93a..63d74107 100644 --- a/dependencies/astron/dclass/stride.dc +++ b/dependencies/astron/dclass/stride.dc @@ -150,7 +150,7 @@ dclass DistributedPlayer : DistributedAvatar { setSC(uint16 msgIndex) broadcast ownsend airecv; setSCCustom(uint16 msgIndex) broadcast ownsend airecv; setFriendsList(uint32[] = []) ownrecv required db airecv; - setDISLid(uint32 = 0) broadcast ownrecv ram db airecv required; + setDISLid(uint32 = 0) airecv ram db; setWishName(string = "") db ram; setWishNameState(string = "OPEN") db ram; setAdminAccess(uint16 = 0) required broadcast ownrecv db; @@ -555,7 +555,7 @@ dclass ToontownDistrict : DistributedDistrict { }; dclass ToontownDistrictStats : DistributedObject { - settoontownDistrictId(uint32) broadcast required ram; + setDistrictId(uint32) broadcast required ram; setAvatarCount(uint32) broadcast required ram; setInvasionStatus(uint8) broadcast required ram; }; @@ -726,7 +726,6 @@ dclass DistributedToon : DistributedPlayer { setGolfCourseBest(uint8 [3] = [0*3]) required ownrecv db; setUnlimitedSwing(uint8) broadcast ownrecv ram; logSuspiciousEvent(char [0-1024]) ownsend airecv; - logMessage(char [0-1024]) ownsend airecv; forceLogoutWithNotify() ownrecv; setPinkSlips(uint8 = 0) required ownrecv db; setNametagStyle(uint8 = 0) required broadcast ownrecv db; @@ -743,7 +742,6 @@ dclass DistributedToon : DistributedPlayer { setPartyStatus(uint64, uint8) ownrecv airecv; announcePartyStarted(uint64) ownrecv; setNeverStartedPartyRefunded(uint64, int8, uint16) ownrecv; - setDISLid(uint32) ram db airecv; setAnimalSound(uint8 index) ram broadcast ownrecv; setBuffs(uint32[] = []) required ownrecv db; setRedeemedCodes(string [] = []) required ownrecv db; @@ -3165,27 +3163,27 @@ dclass DistributedPartyManager : DistributedObject { }; dclass GlobalLobbyManager : DistributedObjectGlobal { - lobbyManagerAIHello(uint32 channel); - queryLobby(uint32 hostId); - addLobby(DoId avId, uint64 lobbyId); - toonJoinedLobby(uint64 lobbyId, uint32 avId); - toonLeftLobby(uint64 lobbyId, uint32 avId); - requestLobbySlot(uint64 lobbyId, uint32 avId); - lobbyDone(uint64 lobbyId); - allocIds(uint16 count); + lobbyManagerAIHello(uint32 channel); + queryLobby(uint32 hostId); + addLobby(DoId avId, uint64 lobbyId); + toonJoinedLobby(uint64 lobbyId, uint32 avId); + toonLeftLobby(uint64 lobbyId, uint32 avId); + requestLobbySlot(uint64 lobbyId, uint32 avId); + lobbyDone(uint64 lobbyId); + allocIds(uint16 count); }; dclass GlobalPartyManager : DistributedObjectGlobal { - partyManagerAIHello(uint32 channel); - queryParty(uint32 hostId); - addParty(DoId avId, uint64 partyId, string start, string end, int8 isPrivate, - int8 inviteTheme, activity [], decoration [], DoIdList inviteeIds); - partyHasStarted(uint64 partyId, uint32 shardId, uint32 zoneId, string hostName); - toonJoinedParty(uint64 partyId, uint32 avId); - toonLeftParty(uint64 partyId, uint32 avId); - requestPartySlot(uint64 partyId, uint32 avId, uint32 gateId); - partyDone(uint64 partyId); - allocIds(uint16 count); + partyManagerAIHello(uint32 channel); + queryParty(uint32 hostId); + addParty(DoId avId, uint64 partyId, string start, string end, int8 isPrivate, + int8 inviteTheme, activity [], decoration [], DoIdList inviteeIds); + partyHasStarted(uint64 partyId, uint32 shardId, uint32 zoneId, string hostName); + toonJoinedParty(uint64 partyId, uint32 avId); + toonLeftParty(uint64 partyId, uint32 avId); + requestPartySlot(uint64 partyId, uint32 avId, uint32 gateId); + partyDone(uint64 partyId); + allocIds(uint16 count); }; struct PotentialToon { diff --git a/otp/ai/BanManagerAI.py b/otp/ai/BanManagerAI.py index 9b53f4a1..6cb300fd 100755 --- a/otp/ai/BanManagerAI.py +++ b/otp/ai/BanManagerAI.py @@ -122,8 +122,6 @@ def kick(reason='No reason specified'): Kick the target from the game server. """ target = spellbook.getTarget() - if target == spellbook.getInvoker(): - return "You can't kick yourself!" datagram = PyDatagram() datagram.addServerHeader( target.GetPuppetConnectionChannel(target.doId), diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index c9ef9f5d..f4c3809e 100755 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -191,7 +191,7 @@ class ToontownAIRepository(ToontownInternalRepository): self.claimOwnership(self.districtId) self.districtStats = ToontownDistrictStatsAI(self) - self.districtStats.settoontownDistrictId(self.districtId) + self.districtStats.setDistrictId(self.districtId) self.districtStats.generateWithRequiredAndId( self.allocateChannel(), self.getGameDoId(), 3) self.notify.info('Created ToontownDistrictStats(%d)' % self.districtStats.doId) diff --git a/toontown/distributed/ToontownDistrictStats.py b/toontown/distributed/ToontownDistrictStats.py index 8cf519f1..38f25034 100755 --- a/toontown/distributed/ToontownDistrictStats.py +++ b/toontown/distributed/ToontownDistrictStats.py @@ -67,15 +67,15 @@ class ToontownDistrictStats(DistributedObject.DistributedObject): def __init__(self, cr): DistributedObject.DistributedObject.__init__(self, cr) - self.toontownDistrictId = 0 + self.districtId = 0 - def settoontownDistrictId(self, value): - self.toontownDistrictId = value + def setDistrictId(self, value): + self.districtId = value def setAvatarCount(self, avatarCount): - if self.toontownDistrictId in self.cr.activeDistrictMap: - self.cr.activeDistrictMap[self.toontownDistrictId].avatarCount = avatarCount + if self.districtId in self.cr.activeDistrictMap: + self.cr.activeDistrictMap[self.districtId].avatarCount = avatarCount def setInvasionStatus(self, invasionStatus): - if self.toontownDistrictId in self.cr.activeDistrictMap: - self.cr.activeDistrictMap[self.toontownDistrictId].invasionStatus = invasionStatus \ No newline at end of file + if self.districtId in self.cr.activeDistrictMap: + self.cr.activeDistrictMap[self.districtId].invasionStatus = invasionStatus \ No newline at end of file diff --git a/toontown/distributed/ToontownDistrictStatsAI.py b/toontown/distributed/ToontownDistrictStatsAI.py index 0364cc43..73d2cc59 100755 --- a/toontown/distributed/ToontownDistrictStatsAI.py +++ b/toontown/distributed/ToontownDistrictStatsAI.py @@ -20,17 +20,17 @@ class ToontownDistrictStatsAI(DistributedObjectAI): status = {'population': self.avatarCount} self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status]) - def settoontownDistrictId(self, districtId): + def setDistrictId(self, districtId): self.districtId = districtId - def d_settoontownDistrictId(self, districtId): - self.sendUpdate('settoontownDistrictId', [districtId]) + def d_setDistrictId(self, districtId): + self.sendUpdate('setDistrictId', [districtId]) - def b_settoontownDistrictId(self, districtId): - self.settoontownDistrictId(districtId) - self.d_settoontownDistrictId(districtId) + def b_setDistrictId(self, districtId): + self.setDistrictId(districtId) + self.d_setDistrictId(districtId) - def gettoontownDistrictId(self): + def getDistrictId(self): return self.districtId def setAvatarCount(self, avatarCount): diff --git a/toontown/minigame/DistributedTwoDGame.py b/toontown/minigame/DistributedTwoDGame.py index 838bb1ef..6cbb3c43 100755 --- a/toontown/minigame/DistributedTwoDGame.py +++ b/toontown/minigame/DistributedTwoDGame.py @@ -474,10 +474,8 @@ class DistributedTwoDGame(DistributedMinigame): self.updateScore(avId, ToonBlitzGlobals.ScoreGainPerTreasure * treasure.value) else: self.notify.error('WHOA!! treasureIndex %s is out of range; numTreasures = %s' % (treasureIndex, numTreasures)) - base.localAvatar.sendLogMessage('treasureIndex %s is out of range; numTreasures = %s' % (treasureIndex, numTreasures)) else: self.notify.error('WHOA!! sectionIndex %s is out of range; numSections = %s' % (sectionIndex, numSections)) - base.localAvatar.sendLogMessage('sectionIndex %s is out of range; numSections = %s' % (sectionIndex, numSections)) def __enemyShot(self, sectionIndex, enemyIndex): self.sectionMgr.sections[sectionIndex].enemyMgr.enemies[enemyIndex].doShotTrack() diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index fa6f4637..167971b3 100755 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -2041,9 +2041,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute for soundSequence in removeList: self.soundSequenceList.remove(soundSequence) - def sendLogMessage(self, message): - self.sendUpdate('logMessage', [message]) - def setChatAbsolute(self, chatString, chatFlags, dialogue = None, interrupt = 1, quiet = 0): DistributedAvatar.DistributedAvatar.setChatAbsolute(self, chatString, chatFlags, dialogue, interrupt) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index f700cb39..032d0dba 100755 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -3655,13 +3655,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def getNametagStyle(self): return self.nametagStyle - def logMessage(self, message): - avId = self.air.getAvatarIdFromSender() - try: - self.air.writeServerEvent('clientLog', avId, message) - except: - self.air.writeServerEvent('suspicious', avId, 'client sent us a clientLog that caused an exception') - def b_setMail(self, mail): self.d_setMail(mail) self.setMail(mail) diff --git a/toontown/toon/DistributedToonUD.py b/toontown/toon/DistributedToonUD.py index 4ea09268..8acf5e3b 100755 --- a/toontown/toon/DistributedToonUD.py +++ b/toontown/toon/DistributedToonUD.py @@ -457,9 +457,6 @@ class DistributedToonUD(DistributedObjectUD): def logSuspiciousEvent(self, todo0): pass - def logMessage(self, todo0): - pass - def forceLogoutWithNotify(self): pass