def toonJoinRequest(self):
     DistributedPartyActivityAI.toonJoinRequest(self)
     avId = self.air.getAvatarIdFromSender()
     self.player2catches[avId] = 0
     if not self.playing:
         self.__startGame()
         self.sendUpdate('setState', ['Active', globalClockDelta.getRealNetworkTime()])
    def toonJoinRequest(self, team):
        av = self._getCaller()
        if not av:
            return

        if not self.fsm.state in ('WaitForEnough', 'WaitToStart'):
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied',
                                      [PartyGlobals.DenialReasons.Default])
            return

        if len(self.toonIds[team]) >= self.getPlayersPerTeam()[1]:
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied',
                                      [PartyGlobals.DenialReasons.Full])
            return

        if av.doId in self.toonsPlaying:
            self.air.writeServerEvent(
                'suspicious', av.doId,
                'tried to join party team activity again!')
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied',
                                      [PartyGlobals.DenialReasons.Default])
            return

        # We need to care if they exit before being appended to prevent District Resets.
        if av.doId in self.air.doId2do:
            self.toonIds[team].append(av.doId)
            DistributedPartyActivityAI.toonJoinRequest(self)
            self.__update()
        else:
            self.notify.warning(
                "Toon %d joined activity but left unexpectdly!" % (av.doId))
            return
Ejemplo n.º 3
0
    def toonJoinRequest(self, team):
        av = self._getCaller()
        if not av:
            return

        if not self.fsm.state in ('WaitForEnough', 'WaitToStart'):
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied',
                                      [PartyGlobals.DenialReasons.Default])
            return

        if len(self.toonIds[team]) >= self.getPlayersPerTeam()[1]:
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied',
                                      [PartyGlobals.DenialReasons.Full])
            return

        if av.doId in self.toonsPlaying:
            print("Toon is already playing!")
            self.air.writeServerEvent(
                'suspicious', av.doId,
                'tried to join party team activity again!')
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied',
                                      [PartyGlobals.DenialReasons.Default])
            return

        # idgaf if they exit unexpectedly in this case
        self.toonIds[team].append(av.doId)
        DistributedPartyActivityAI.toonJoinRequest(self)
        self.__update()
Ejemplo n.º 4
0
    def toonJoinRequest(self, team):
        av = self._getCaller()
        if not av:
            return

        if not self.fsm.state_ in ('WaitForEnough', 'WaitToStart'):
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied', [PartyGlobals.DenialReasons.Default])
            return

        if len(self.toonIds[team]) >= self.getPlayersPerTeam()[1]:
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied', [PartyGlobals.DenialReasons.Full])
            return

        if av.doId in self.toonsPlaying:
            print "Toon is already playing!"
            self.air.writeServerEvent('suspicious', av.doId, 'tried to join party team activity again!')
            self.sendUpdateToAvatarId(av.doId, 'joinRequestDenied', [PartyGlobals.DenialReasons.Default])
            return

        # idgaf if they exit unexpectedly in this case
        self.toonIds[team].append(av.doId)
        DistributedPartyActivityAI.toonJoinRequest(self)
        self.__update()