logging: Migrate a batch of files over to key-value

This commit is contained in:
Jeremy Koletar 2014-05-04 20:43:26 -05:00
parent 23b3198628
commit 192f807dfe
26 changed files with 86 additions and 103 deletions

View file

@ -33,7 +33,7 @@ class BanManagerAI:
dislid,
comment,
fullUrl))
simbase.air.writeServerEvent('ban_request', avatarId, '%s|%s|%s' % (dislid, comment, fullUrl))
simbase.air.writeServerEvent('ban-request', avId=avatarId, dislid=dislid, comment=comment, fullUrl=fullUrl)
if simbase.config.GetBool('do-actual-ban', True):
newTaskName = 'ban-task-%d' % self.curBanRequestNum
newTask = taskMgr.add(self.doBanUrlTask, newTaskName)

View file

@ -16,7 +16,7 @@ class MagicWordManagerAI(DistributedObjectAI):
return
if invoker.getAdminAccess() < MINIMUM_MAGICWORD_ACCESS:
self.air.writeServerEvent('suspicious', invokerId, 'Attempted to issue magic word: %s' % word)
self.air.writeServerEvent('suspicious', avId=invokerId, issue='Attempted to issue magic word: %s' % word)
dg = PyDatagram()
dg.addServerHeader(self.GetPuppetConnectionChannel(invokerId), self.air.ourChannel, CLIENTAGENT_EJECT)
dg.addUint16(126)
@ -34,6 +34,6 @@ class MagicWordManagerAI(DistributedObjectAI):
self.sendUpdateToAvatarId(invokerId, 'sendMagicWordResponse', [response])
self.air.writeServerEvent('magic-word',
invokerId, invoker.getAdminAccess(),
targetId, target.getAdminAccess(),
word, response)
invokerId=invokerId, invokerAccess=invoker.getAdminAccess(),
targetId=targetId, targetAccess=target.getAdminAccess(),
word=word, response=response)

View file

@ -14,11 +14,11 @@ class TimeManagerAI(DistributedObjectAI):
def setDisconnectReason(self, reason):
avId = self.air.getAvatarIdFromSender()
self.air.writeServerEvent('disconnect-reason', avId, reason)
self.air.writeServerEvent('disconnect-reason', avId=avId, reason=reason)
def setExceptionInfo(self, exception):
avId = self.air.getAvatarIdFromSender()
self.air.writeServerEvent('client-exception', avId, exception)
self.air.writeServerEvent('client-exception', avId=avId, exception=exception)
def setSignature(self, todo0, todo1, todo2):
pass

View file

@ -95,6 +95,6 @@ class DistributedAvatarAI(DistributedNodeAI.DistributedNodeAI):
def setParentStr(self, parentToken):
if parentToken:
senderId = self.air.getAvatarIdFromSender()
self.air.writeServerEvent('Admin chat warning', senderId, 'using setParentStr to send "%s"' % parentToken)
self.air.writeServerEvent('suspicious', avId=senderId, issue='Admin chat, 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)

View file

@ -55,7 +55,7 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
if self.isPlayerControlled():
if not self.air._isValidPlayerLocation(parentId, zoneId):
self.notify.info('booting player %s for doing setLocation to (%s, %s)' % (self.doId, parentId, zoneId))
self.air.writeServerEvent('suspicious', self.doId, 'invalid setLocation: (%s, %s)' % (parentId, zoneId))
self.air.writeServerEvent('suspicious', avId=self.doId, issue='invalid setLocation: (%s, %s)' % (parentId, zoneId))
self.requestDelete()
def _doPlayerEnter(self):
@ -84,7 +84,7 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
def d_setMaxHp(self, maxHp):
DistributedAvatarAI.DistributedAvatarAI.d_setMaxHp(self, maxHp)
self.air.writeServerEvent('setMaxHp', self.doId, '%s' % maxHp)
self.air.writeServerEvent('setMaxHp', avId=self.doId, hp='%s' % maxHp)
def d_setSystemMessage(self, aboutId, chatString):
self.sendUpdate('setSystemMessage', [aboutId, chatString])

View file

@ -14,8 +14,8 @@ class ChatAgentUD(DistributedObjectGlobalUD):
def chatMessage(self, message):
sender = self.air.getAvatarIdFromSender()
if sender == 0:
self.air.writeServerEvent('suspicious', self.air.getAccountIdFromSender(),
'Account sent chat without an avatar', message)
self.air.writeServerEvent('suspicious', accId=self.air.getAccountIdFromSender(),
issue='Account sent chat without an avatar', message=message)
return
modifications = []

View file

@ -14,7 +14,7 @@ class FriendManagerAI(DistributedObjectAI):
def friendQuery(self, requested):
avId = self.air.getAvatarIdFromSender()
if not requested in self.air.doId2do:
self.air.writeServerEvent('suspicious', avId, 'Player tried to friend a player that does not exist!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to friend a player that does not exist!')
return
context = self.currentContext
self.requests[context] = [ [ avId, requested ], 'friendQuery']
@ -24,10 +24,10 @@ class FriendManagerAI(DistributedObjectAI):
def cancelFriendQuery(self, context):
avId = self.air.getAvatarIdFromSender()
if not context in self.requests:
self.air.writeServerEvent('suspicious', avId, 'Player tried to cancel a request that doesn\'t exist!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to cancel a request that doesn\'t exist!')
return
if avId != self.requests[context][0][0]:
self.air.writeServerEvent('suspicious', avId, 'Player tried to cancel someone elses request!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to cancel someone elses request!')
return
self.requests[context][1] = 'cancelled'
self.sendUpdateToAvatarId(self.requests[context][0][1], 'inviteeCancelFriendQuery', [context])
@ -35,13 +35,13 @@ class FriendManagerAI(DistributedObjectAI):
def inviteeFriendConsidering(self, yesNo, context):
avId = self.air.getAvatarIdFromSender()
if not context in self.requests:
self.air.writeServerEvent('suspicious', avId, 'Player tried to consider a friend request that doesn\'t exist!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to consider a friend request that doesn\'t exist!')
return
if avId != self.requests[context][0][1]:
self.air.writeServerEvent('suspicious', avId, 'Player tried to consider for someone else!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to consider for someone else!')
return
if self.requests[context][1] != 'friendQuery':
self.air.writeServerEvent('suspicious', avId, 'Player tried to reconsider friend request!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to reconsider friend request!')
return
if yesNo != 1:
self.sendUpdateToAvatarId(self.requests[context][0][0], 'friendConsidering', [yesNo, context])
@ -53,13 +53,13 @@ class FriendManagerAI(DistributedObjectAI):
def inviteeFriendResponse(self, response, context):
avId = self.air.getAvatarIdFromSender()
if not context in self.requests:
self.air.writeServerEvent('suspicious', avId, 'Player tried to respond to a friend request that doesn\'t exist!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to respond to a friend request that doesn\'t exist!')
return
if avId != self.requests[context][0][1]:
self.air.writeServerEvent('suspicious', avId, 'Player tried to respond to someone else\'s request!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to respond to someone else\'s request!')
return
if self.requests[context][1] == 'cancelled':
self.air.writeServerEvent('suspicious', avId, 'Player tried to respond to non-active friend request!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to respond to non-active friend request!')
return
self.sendUpdateToAvatarId(self.requests[context][0][0], 'friendResponse', [response, context])
if response == 1:
@ -77,13 +77,13 @@ class FriendManagerAI(DistributedObjectAI):
def inviteeAcknowledgeCancel(self, context):
avId = self.air.getAvatarIdFromSender()
if not context in self.requests:
self.air.writeServerEvent('suspicious', avId, 'Player tried to acknowledge the cancel of a friend request that doesn\'t exist!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to acknowledge the cancel of a friend request that doesn\'t exist!')
return
if avId != self.requests[context][0][1]:
self.air.writeServerEvent('suspicious', avId, 'Player tried to acknowledge someone else\'s cancel!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to acknowledge someone else\'s cancel!')
return
if self.requests[context][1] != 'cancelled':
self.air.writeServerEvent('suspicious', avId, 'Player tried to cancel non-cancelled request!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Player tried to cancel non-cancelled request!')
return
del self.requests[context]

View file

@ -20,7 +20,7 @@ class ServerEventBuffer:
return
def writeEvent(self, msg):
self.air.writeServerEvent(self.name, self.avId, msg)
self.air.writeServerEvent(self.name, avId=self.avId, msg=msg)
def considerFlush(self):
if self.lastFlushTime is None:

View file

@ -50,5 +50,5 @@ except SystemExit:
raise
except Exception:
info = PythonUtil.describeException()
simbase.air.writeServerEvent('ai-exception', simbase.air.getAvatarIdFromSender(), simbase.air.getAccountIdFromSender(), info)
simbase.air.writeServerEvent('ai-exception', avId=simbase.air.getAvatarIdFromSender(), accId=simbase.air.getAccountIdFromSender(), exception=info)
raise

View file

@ -516,7 +516,7 @@ class BattleCalculatorAI:
numLeft = 0
toon.b_setPinkSlips(numLeft)
if costToFire > abilityToFire:
simbase.air.writeServerEvent('suspicious', toonId, 'Toon attempting to fire a %s cost cog with %s pinkslips' % (costToFire, abilityToFire))
simbase.air.writeServerEvent('suspicious', avId=toonId, issue='Toon attempting to fire a %s cost cog with %s pinkslips' % (costToFire, abilityToFire))
print 'Not enough PinkSlips to fire cog - print a warning here'
else:
suit.skeleRevives = 0

View file

@ -1011,11 +1011,11 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
validResponse = 1
if track == SOS:
self.notify.debug('toon: %d calls for help' % toonId)
self.air.writeServerEvent('friendSOS', toonId, '%s' % av)
self.air.writeServerEvent('friend-sos', avId=toonId, target='%s' % av)
self.toonAttacks[toonId] = getToonAttack(toonId, track=SOS, target=av)
elif track == NPCSOS:
self.notify.debug('toon: %d calls for help' % toonId)
self.air.writeServerEvent('NPCSOS', toonId, '%s' % av)
self.air.writeServerEvent('npc-sos', avId=toonId, target='%s' % av)
toon = self.getToon(toonId)
if toon == None:
return
@ -1032,7 +1032,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
self.npcAttacks[av] = toonId
elif track == PETSOS:
self.notify.debug('toon: %d calls for pet: %d' % (toonId, av))
self.air.writeServerEvent('PETSOS', toonId, '%s' % av)
self.air.writeServerEvent('pet-sos', avId=toonId, target='%s' % av)
toon = self.getToon(toonId)
if toon == None:
return
@ -1340,7 +1340,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
if toon != None:
check = toon.inventory.useItem(track, level)
if check == -1:
self.air.writeServerEvent('suspicious', toonId, 'Toon generating movie for non-existant gag track %s level %s' % (track, level))
self.air.writeServerEvent('suspicious', avId=toonId, issue='Toon generating movie for non-existant gag track %s level %s' % (track, level))
self.notify.warning('generating movie for non-existant gag track %s level %s! avId: %s' % (track, level, toonId))
toon.d_setInventory(toon.inventory.makeNetString())
hps = attack[TOON_HP_COL]
@ -1552,7 +1552,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
if not (hasattr(suit, 'dna') and suit.dna):
toonId = self.air.getAvatarIdFromSender()
self.notify.warning('_movieDone avoiding crash, sender=%s but suit has no dna' % toonId)
self.air.writeServerEvent('suspicious', toonId, '_movieDone avoiding crash, suit has no dna')
self.air.writeServerEvent('suspicious', avId=toonId, issue='_movieDone avoiding crash, suit has no dna')
continue
adict = getSuitAttack(suit.getStyleName(), suit.getLevel(), attack)
hps = self.suitAttacks[i][SUIT_HP_COL]
@ -1665,7 +1665,7 @@ class DistributedBattleBaseAI(DistributedObjectAI.DistributedObjectAI, BattleBas
msgText += ','
msgText += '%s%s' % (count, msgName)
self.air.writeServerEvent('battleCogsDefeated', self.doId, '%s|%s' % (msgText, self.getTaskZoneId()))
self.air.writeServerEvent('battle-cogs-defeated', battleId=self.doId, msgText=msgText, taskZoneId=self.getTaskZoneId())
def exitResume(self):
pass

View file

@ -221,7 +221,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
def recordVictorResponse(self, avId):
index = self.findVictorIndex(avId)
if index == None:
self.air.writeServerEvent('suspicious', avId, 'DistributedBuildingAI.setVictorReady from toon not in %s.' % self.victorList)
self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedBuildingAI.setVictorReady from toon not in %s.' % self.victorList)
return
self.victorResponses[index] = avId
return
@ -235,7 +235,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
def setVictorReady(self):
avId = self.air.getAvatarIdFromSender()
if self.victorResponses == None:
self.air.writeServerEvent('suspicious', avId, 'DistributedBuildingAI.setVictorReady in state %s.' % self.fsm.getCurrentState().getName())
self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedBuildingAI.setVictorReady in state %s.' % self.fsm.getCurrentState().getName())
return
self.recordVictorResponse(avId)
event = self.air.getAvatarExitEvent(avId)
@ -288,10 +288,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
toon = None
if t:
toon = self.getToon(t)
self.air.writeServerEvent('buildingDefeated', t, '%s|%s|%s|%s' % (self.track,
self.numFloors,
self.zoneId,
victorList))
self.air.writeServerEvent('building-defeated', avId=t, track=self.track, numFloors=self.numFloors, zoneId=self.zoneId, victorList='%s' % victorList)
if toon != None:
self.air.questManager.toonKilledBuilding(toon, self.track, self.difficulty, self.numFloors, self.zoneId, activeToons)
@ -333,10 +330,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
toon = None
if t:
toon = self.getToon(t)
self.air.writeServerEvent('buildingDefeated', t, '%s|%s|%s|%s' % (self.track,
self.numFloors,
self.zoneId,
victorList))
self.air.writeServerEvent('building-defeated', avId=t, track=self.track, numFloors=self.numFloors, zoneId=self.zoneId, victorList='%s' % victorList)
if toon != None:
self.air.questManager.toonKilledCogdo(toon, self.difficulty, self.numFloors, self.zoneId, activeToons)
@ -409,7 +403,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
self.becameSuitTime = 0
self.knockKnock = DistributedKnockKnockDoorAI.DistributedKnockKnockDoorAI(self.air, self.block)
self.knockKnock.generateWithRequired(exteriorZoneId)
self.air.writeServerEvent('building-toon', self.doId, '%s|%s' % (self.zoneId, self.block))
self.air.writeServerEvent('building-toon', buildingId=self.doId, zoneId=self.zoneId, block=self.block)
def createExteriorDoor(self):
result = DistributedDoorAI.DistributedDoorAI(self.air, self.block, DoorTypes.EXT_STANDARD)
@ -465,10 +459,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
exteriorZoneId, interiorZoneId = self.getExteriorAndInteriorZoneId()
self.elevator = DistributedElevatorExtAI.DistributedElevatorExtAI(self.air, self)
self.elevator.generateWithRequired(exteriorZoneId)
self.air.writeServerEvent('building-cog', self.doId, '%s|%s|%s|%s' % (self.zoneId,
self.block,
self.track,
self.numFloors))
self.air.writeServerEvent('building-cog', buildingId=self.doId, zoneId=self.zoneId, block=self.block, track=self.track, numFloors=self.numFloors)
def exitSuit(self):
del self.planner
@ -524,7 +515,7 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
exteriorZoneId, interiorZoneId = self.getExteriorAndInteriorZoneId()
self.elevator = DistributedCogdoElevatorExtAI(self.air, self)
self.elevator.generateWithRequired(exteriorZoneId)
self.air.writeServerEvent('building-cogdo', self.doId, '%s|%s|%s' % (self.zoneId, self.block, self.numFloors))
self.air.writeServerEvent('building-cogdo', buildingId=self.doId, zoneId=self.zoneId, block=self.block, numFloors=self.numFloors)
def exitCogdo(self):
del self.planner

View file

@ -184,7 +184,7 @@ class DistributedSuitInteriorAI(DistributedObjectAI.DistributedObjectAI):
def setAvatarJoined(self):
avId = self.air.getAvatarIdFromSender()
if self.toons.count(avId) == 0:
self.air.writeServerEvent('suspicious', avId, 'DistributedSuitInteriorAI.setAvatarJoined from toon not in %s.' % self.toons)
self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedSuitInteriorAI.setAvatarJoined from toon not in %s.' % self.toons)
self.notify.warning('setAvatarJoined() - av: %d not in list' % avId)
return
avatar = self.air.doId2do.get(avId)

View file

@ -29,7 +29,7 @@ class DistributedCrateAI(DistributedCrushableEntityAI.DistributedCrushableEntity
1,
2,
3]:
self.air.writeServerEvent('suspicious', avId, 'DistributedCrateAI.requestPush given invalid side arg')
self.air.writeServerEvent('suspicious', avId=avId, issue='DistributedCrateAI.requestPush given invalid side arg')
return
if not self.avId and self.grid.checkPush(self.entId, side):
self.avId = avId

View file

@ -49,12 +49,8 @@ class DistributedFactoryAI(DistributedLevelAI.DistributedLevelAI, FactoryBase.Fa
self.reserveSuits = suitHandles['reserveSuits']
self.d_setSuits()
scenario = 0
description = '%s|%s|%s|%s' % (self.factoryId,
self.entranceId,
scenario,
self.avIdList)
for avId in self.avIdList:
self.air.writeServerEvent('factoryEntered', avId, description)
self.air.writeServerEvent('factory-entered', avId=avId, factoryId=self.factoryId, entranceId=self.entranceId, scenario=scenario, avIds=avIdList)
self.notify.info('finish factory %s %s creation' % (self.factoryId, self.doId))
@ -98,12 +94,8 @@ class DistributedFactoryAI(DistributedLevelAI.DistributedLevelAI, FactoryBase.Fa
activeVictorIds.append(victorId)
scenario = 0
description = '%s|%s|%s|%s' % (self.factoryId,
self.entranceId,
scenario,
activeVictorIds)
for avId in activeVictorIds:
self.air.writeServerEvent('factoryDefeated', avId, description)
self.air.writeServerEvent('factory-defeated', avId=avId, factoryId=self.factoryId, entranceId=self.entranceId, scenario=scenario, avIds=activeVictorIds)
for toon in activeVictors:
simbase.air.questManager.toonDefeatedFactory(toon, self.factoryId, activeVictors)

View file

@ -53,7 +53,7 @@ class DistributedLiftAI(DistributedEntityAI.DistributedEntityAI):
avId = self.air.getAvatarIdFromSender()
avatar = self.air.doId2do.get(avId)
if not avatar:
self.air.writeServerEvent('suspicious', avId, 'LiftAI.setAvatarEnter avId not valid')
self.air.writeServerEvent('suspicious', avId=avId, issue='LiftAI.setAvatarEnter avId not valid')
return
self.notify.debug('setAvatarEnter: %s' % avId)
if avId in self.boardedAvs:

View file

@ -73,6 +73,6 @@ class PromotionManagerAI:
av.b_setCogMerits(merits)
if reduce(lambda x, y: x + y, actualCounted):
self.air.writeServerEvent('merits', avId, '%s|%s|%s|%s' % tuple(actualCounted))
self.air.writeServerEvent('merits', avId=avId, bossbot=actualCounted[0], lawbot=actualCounted[1], cashbot=actualCounted[2], sellbot=actualCounted[3])
self.notify.debug('recoverMerits: av %s recovered merits %s' % (avId, actualCounted))
return meritsRecovered

View file

@ -63,7 +63,7 @@ class DistributedElectionEventAI(DistributedObjectAI, FSM):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId, None)
if not av:
self.air.writeServerEvent('suspicious', avId, 'Someone tried to talk to Flippy while they aren\'t on the district!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Someone tried to talk to Flippy while they aren\'t on the district!')
return
self.sendUpdate('flippySpeech', [avId, phraseId])
@ -71,7 +71,7 @@ class DistributedElectionEventAI(DistributedObjectAI, FSM):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId, None)
if not av:
self.air.writeServerEvent('suspicious', avId, 'Got a request for pies from a toon that isn\'t on the district!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Got a request for pies from a toon that isn\'t on the district!')
return
if av.hp > 0:
av.b_setPieType(self.pieTypeAmount[0])
@ -87,7 +87,7 @@ class DistributedElectionEventAI(DistributedObjectAI, FSM):
avId = self.air.getAvatarIdFromSender()
av = self.air.doId2do.get(avId, None)
if not av:
self.air.writeServerEvent('suspicious', avId, 'Got a request for Slappy\'s Cheesy Effect from a toon that isn\'t on the district!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Got a request for Slappy\'s Cheesy Effect from a toon that isn\'t on the district!')
return
av.b_setCheesyEffect(15, 0, 0)
@ -235,7 +235,7 @@ class DistributedElectionEventAI(DistributedObjectAI, FSM):
@magicWord(category=CATEGORY_MODERATION, types=[str])
def election(state):
if not simbase.config.GetBool('want-doomsday', False):
simbase.air.writeServerEvent('aboose', spellbook.getInvoker().doId, 'Attempted to change the election state while doomsday is disabled.')
simbase.air.writeServerEvent('warning', avId=spellbook.getInvoker().doId, issue='Attempted to change the election state while doomsday is disabled.')
return 'ABOOSE! The election is currently disabled. Your request has been logged.'
event = simbase.air.doFind('ElectionEvent')

View file

@ -284,7 +284,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM):
avId = self.air.getAvatarIdFromSender()
toon = self.air.doId2do.get(avId)
if not toon:
self.air.writeServerEvent('suspicious', avId, 'Nonexistent Toon tried to get hit!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Nonexistent Toon tried to get hit!')
return
# If the cog's attack is higher than the amount of laff they have, we'll only take away what they have.
# If the attack is 5 and the toon has 3 laff, we'll only take away 3 laff. This mostly prevents toons going under 0 Laff.
@ -301,11 +301,11 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM):
avId = self.air.getAvatarIdFromSender()
toon = self.air.doId2do.get(doId)
if not toon:
self.air.writeServerEvent('suspicious', avId, 'Hit a nonexistent Toon with a pie!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Hit a nonexistent Toon with a pie!')
return
from toontown.toon.DistributedToonAI import DistributedToonAI
if not isinstance(toon, DistributedToonAI):
self.air.writeServerEvent('suspicious', avId, 'Hit a non-Toon with a pie through healToon()!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Hit a non-Toon with a pie through healToon()!')
return
# Just to be safe, let's check if the Toon has less than 0 laff.
# Sometimes this happens from multiple cog hits at once.
@ -368,7 +368,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM):
avId = self.air.getAvatarIdFromSender()
toon = self.air.doId2do.get(avId)
if not toon:
self.air.writeServerEvent('suspicious', avId, 'Nonexistent Toon tried to throw a pie!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Nonexistent Toon tried to throw a pie!')
return
suit = self.air.doId2do.get(doId)
@ -408,7 +408,7 @@ class DistributedSafezoneInvasionAI(DistributedObjectAI, FSM):
@magicWord(category=CATEGORY_DEBUG, types=[str, str])
def szInvasion(cmd, arg=''):
if not simbase.config.GetBool('want-doomsday', False):
simbase.air.writeServerEvent('aboose', spellbook.getInvoker().doId, 'Attempted to initiate doomsday while it is disabled.')
simbase.air.writeServerEvent('warning', avId=spellbook.getInvoker().doId, issue='Attempted to initiate doomsday while it is disabled.')
return 'ABOOSE! Doomsday is currently disabled. Your request has been logged.'
invasion = simbase.air.doFind('SafezoneInvasion')

View file

@ -187,18 +187,18 @@ class DistributedFurnitureManagerAI(DistributedObjectAI):
senderId = self.air.getAvatarIdFromSender()
if self.ownerId != senderId:
self.air.writeServerEvent('suspicious', senderId,
self.air.writeServerEvent('suspicious', avId=senderId,
'Tried to move furniture, but not the house owner!')
return
if senderId != directorId and directorId != 0:
self.air.writeServerEvent('suspicious', senderId,
self.air.writeServerEvent('suspicious', avId=senderId,
'Tried to make someone else (%d) move their furniture!' % directorId)
return
director = self.air.doId2do.get(directorId)
if directorId and not director:
self.air.writeServerEvent('suspicious', directorId,
self.air.writeServerEvent('suspicious', avId=directorId,
'Tried to move furniture without being on the shard!')
return

View file

@ -250,7 +250,7 @@ class EstateManagerAI(DistributedObjectAI):
toon = self.air.doId2do.get(senderId)
if not toon:
self.air.writeServerEvent('suspicious', senderId, 'Sent getEstateZone() but not on district!')
self.air.writeServerEvent('suspicious', avId=senderId, issue='Sent getEstateZone() but not on district!')
return
# If there's an avId included, then the Toon is interested in visiting a
@ -319,7 +319,7 @@ class EstateManagerAI(DistributedObjectAI):
toon = self.air.doId2do.get(senderId)
if not toon:
self.air.writeServerEvent('suspicious', senderId, 'Sent exitEstate() but not on district!')
self.air.writeServerEvent('suspicious', avId=senderId, issue='Sent exitEstate() but not on district!')
return
self._unmapFromEstate(toon)

View file

@ -23,13 +23,13 @@ class DistributedFishingPondAI(DistributedObjectAI):
def hitTarget(self, target):
avId = self.air.getAvatarIdFromSender()
if self.targets.get(target) == None:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to hit nonexistent fishing target!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to hit nonexistent fishing target!')
return
spot = self.hasToon(avId)
if spot:
spot.rewardIfValid(target)
return
self.air.writeServerEvent('suspicious', avId, 'Toon tried to catch fish while not fishing!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to catch fish while not fishing!')
def addTarget(self, target):
self.targets[target.doId] = target

View file

@ -49,17 +49,17 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
avId = self.air.getAvatarIdFromSender()
spot = self.pond.hasToon(avId)
if not spot:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to call bingo while not fishing!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to call bingo while not fishing!')
return
fishTuple = (genus, species)
if (genus != spot.lastFish[1] or species != spot.lastFish[2]) and (spot.lastFish[0] != FishGlobals.BootItem):
self.air.writeServerEvent('suspicious', avId, 'Toon tried to update bingo card with a fish they didn\'t catch!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to update bingo card with a fish they didn\'t catch!')
return
if cardId != self.cardId:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to update expired bingo card!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to update expired bingo card!')
return
if self.state != 'Playing':
self.air.writeServerEvent('suspicious', avId, 'Toon tried to update while the game is not running!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to update while the game is not running!')
return
spot.lastFish = [None, None, None, None]
result = self.bingoCard.cellUpdateCheck(cellId, genus, species)
@ -80,13 +80,13 @@ class DistributedPondBingoManagerAI(DistributedObjectAI):
avId = self.air.getAvatarIdFromSender()
spot = self.pond.hasToon(avId)
if not spot:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to call bingo while not fishing!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to call bingo while not fishing!')
return
if not self.canCall:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to call bingo whle the game is not running!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to call bingo whle the game is not running!')
return
if cardId != self.cardId:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to call bingo with an expired cardId!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to call bingo with an expired cardId!')
return
av = self.air.doId2do[avId]
av.d_announceBingo()

View file

@ -378,7 +378,7 @@ class TTRFriendsManagerUD(DistributedObjectGlobalUD):
# The list is empty. This is suspicious as the client shouldn't send
# a blank list.
self.notify.warning('Received blank list of avIds for requestAvatarInfo from avId %d' % requesterId)
self.air.writeServerEvent('suspicious', requesterId, 'Sent a blank list of avIds for requestAvatarInfo in TTRFMUD')
self.air.writeServerEvent('suspicious', avId=requesterId, issue='Sent a blank list of avIds for requestAvatarInfo in TTRFMUD')
return
fsm = GetToonDataFSM(self, requesterId, avIds[0], functools.partial(self.__avInfoCallback, avIds=avIds[1:]))
fsm.start()
@ -476,7 +476,7 @@ class TTRFriendsManagerUD(DistributedObjectGlobalUD):
if toId not in self.tpRequests:
return
if self.tpRequests.get(toId) != fromId:
self.air.writeServerEvent('suspicious', fromId, 'toon tried to send teleportResponse for a query that isn\'t theirs!')
self.air.writeServerEvent('suspicious', avId=fromId, issue='toon tried to send teleportResponse for a query that isn\'t theirs!')
return
self.sendUpdateToAvatarId(toId, 'teleportResponse', [fromId, available, shardId, hoodId, zoneId])
del self.tpRequests[toId]
@ -496,4 +496,4 @@ class TTRFriendsManagerUD(DistributedObjectGlobalUD):
def sendTalkWhisper(self, toId, message):
fromId = self.air.getAvatarIdFromSender()
self.sendUpdateToAvatarId(toId, 'receiveTalkWhisper', [fromId, message])
self.air.writeServerEvent('whisper-said', fromId, toId, message)
self.air.writeServerEvent('whisper-said', fromId=fromId, toId=toId, message=message)

View file

@ -64,10 +64,10 @@ class DistributedGolfCourseAI(DistributedObjectAI):
def setAvatarJoined(self):
avId = self.air.getAvatarIdFromSender()
if avId not in self.avatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to join a golf game they\'re not in!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to join a golf game they\'re not in!')
return
if avId in self.joinedAvatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to join a golf course twice!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to join a golf course twice!')
return
self.acceptOnce(self.air.getAvatarExitEvent(avId), self.forceExit)
self.joinedAvatars.append(avId)

View file

@ -53,10 +53,10 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI):
def setAvatarReadyHole(self):
avId = self.air.getAvatarIdFromSender()
if not avId in self.avatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to join a hole for a game of golf they\'re not in!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to join a hole for a game of golf they\'re not in!')
return
if avId in self.readyAvatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to join a golf hole twice!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to join a golf hole twice!')
return
self.readyAvatars.append(avId)
if set(self.readyAvatars) == set(self.avatars):
@ -78,10 +78,10 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI):
def turnDone(self):
avId = self.air.getAvatarIdFromSender()
if not avId in self.avatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to end their turn in a golf game they\'re not playing in!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to end their turn in a golf game they\'re not playing in!')
return
if avId != self.curGolfer:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to end someone else\'s turn in a game of golf!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to end someone else\'s turn in a game of golf!')
return
avIndex = self.avatars.index(avId)
if set(self.avatars) == set(self.finishedAvatars):
@ -117,13 +117,13 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI):
#THIS FUNCTION IS NEVER CALLED BY THE DISNEY CLIENT
avId = self.air.getAvatarIdFromSender()
if not avId in self.avatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to get a hole in a golf game they\'re not playing in!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to get a hole in a golf game they\'re not playing in!')
return
if avId in self.finishedAvatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to get a hole twice!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to get a hole twice!')
return
if avId != self.curGolfer:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to get a hole while someone else is golfing!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to get a hole while someone else is golfing!')
return
self.finishedAvatars.append(avId)
@ -158,10 +158,10 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI):
def setAvatarTee(self, tee):
avId = self.air.getAvatarIdFromSender()
if not avId in self.avatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to set their tee in a game they\'re not in!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to set their tee in a game they\'re not in!')
return
if avId != self.curGolfer:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to set their tee while not being the current golfer!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to set their tee while not being the current golfer!')
return
self.sendUpdate('setAvatarFinalTee', [avId, tee])
self.sendUpdate('golfersTurn', [avId])
@ -172,10 +172,10 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI):
def postSwingState(self, cycleTime, power, bX, bY, bZ, x, y, aimTime, cod):
avId = self.air.getAvatarIdFromSender()
if not avId in self.avatars:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to swing in a golf game they\'re not playing in!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to swing in a golf game they\'re not playing in!')
return
if avId != self.curGolfer:
self.air.writeServerEvent('suspicious', avId, 'Toon tried to golf outside of their turn!')
self.air.writeServerEvent('suspicious', avId=avId, issue='Toon tried to golf outside of their turn!')
return
if len(self.avatars) == 1:
self.assignedAvatar = self.avatars[0]
@ -194,7 +194,7 @@ class DistributedGolfHoleAI(DistributedPhysicsWorldAI):
def ballMovie2AI(self, cycleTime, avId, recording, aVRecording, ballInHoleFrame, ballTouchedHoleFrame, ballFirstTouchedHoleFrame, COD):
sender = self.air.getAvatarIdFromSender()
if sender != self.assignedAvatar:
self.air.writeServerEvent('suspicious', sender, 'Toon tried to send ball movie with no assigned sender!')
self.air.writeServerEvent('suspicious', avId=sender, issue='Toon tried to send ball movie with no assigned sender!')
return
if ballInHoleFrame != 0:
self.finishedAvatars.append(avId)