def toonExitRequest(self, team): av = self._getCaller() if not av: return if not self.fsm.state in ('WaitForEnough', 'WaitToStart'): self.sendUpdateToAvatarId(av.doId, 'exitRequestDenied', [PartyGlobals.DenialReasons.Default]) return if not (av.doId in self.toonIds[0] or av.doId in self.toonIds[1]): self.air.writeServerEvent( 'suspicious', avId, 'tried to switch DistributedPartyActivityAI team, but not in one' ) self.sendUpdateToAvatarId(av.doId, 'exitRequestDenied', [PartyGlobals.DenialReasons.Default]) return currentTeam = (1, 0)[av.doId in self.toonIds[0]] self.toonIds[currentTeam].remove(av.doId) print(self.toonsPlaying) self.toonsPlaying.remove(av.doId) print(self.toonsPlaying) DistributedPartyActivityAI.toonExitRequest(self) self.__update()
def toonExitRequest(self, team): av = self._getCaller() if not av: return if not self.fsm.state_ in ('WaitForEnough', 'WaitToStart'): self.sendUpdateToAvatarId(av.doId, 'exitRequestDenied', [PartyGlobals.DenialReasons.Default]) return if not (av.doId in self.toonIds[0] or av.doId in self.toonIds[1]): self.air.writeServerEvent('suspicious', avId, 'tried to switch DistributedPartyActivityAI team, but not in one') self.sendUpdateToAvatarId(av.doId, 'exitRequestDenied', [PartyGlobals.DenialReasons.Default]) return currentTeam = (1, 0)[av.doId in self.toonIds[0]] self.toonIds[currentTeam].remove(av.doId) print self.toonsPlaying self.toonsPlaying.remove(av.doId) print self.toonsPlaying DistributedPartyActivityAI.toonExitRequest(self) self.__update()