def _setTeamReady(self, ctx, callback=None):
        if prb_getters.isParentControlActivated():
            g_eventDispatcher.showParentControlNotification()
            if callback:
                callback(False)
            return
        else:
            result = self._limits.isTeamValid()

            def _requestResponse(code, errStr):
                msg = messages.getInvalidTeamServerMessage(errStr, entity=self)
                if msg is not None:
                    SystemMessages.pushMessage(msg, type=SystemMessages.SM_TYPE.Error)
                ctx.onResponseReceived(code)
                return

            if result is None or result.isValid:
                ctx.startProcessing(callback)
                BigWorld.player().prb_teamReady(ctx.getTeam(), ctx.isForced(), ctx.getGamePlayMask(), _requestResponse)
            else:
                notValidReason = result.restriction
                LOG_ERROR('Team is invalid', notValidReason)
                if callback:
                    callback(False)
                SystemMessages.pushMessage(messages.getInvalidTeamMessage(notValidReason, entity=self), type=SystemMessages.SM_TYPE.Error)
            return
예제 #2
0
    def _setTeamReady(self, ctx, callback=None):
        if prb_getters.isParentControlActivated():
            g_eventDispatcher.showParentControlNotification()
            if callback:
                callback(False)
            return
        isValid, notValidReason = self._limits.isTeamValid()

        def _requestResponse(code, errStr):
            msg = messages.getInvalidTeamServerMessage(errStr, functional=self)
            if msg is not None:
                SystemMessages.pushMessage(msg, type=SystemMessages.SM_TYPE.Error)
            ctx.onResponseReceived(code)
            return

        if isValid:
            ctx.startProcessing(callback)
            BigWorld.player().prb_teamReady(ctx.getTeam(), ctx.isForced(), ctx.getGamePlayMask(), _requestResponse)
        else:
            LOG_ERROR("Team is invalid", notValidReason)
            if callback:
                callback(False)
            SystemMessages.pushMessage(
                messages.getInvalidTeamMessage(notValidReason, functional=self), type=SystemMessages.SM_TYPE.Error
            )
예제 #3
0
 def _setTeamReady(self, ctx, callback = None):
     if isParentControlActivated():
         events_dispatcher.showParentControlNotification()
         if callback:
             callback(False)
         return
     isValid, notValidReason = self._limits.isTeamValid()
     if isValid:
         ctx.startProcessing(callback)
         BigWorld.player().prb_teamReady(ctx.getTeam(), ctx.isForced(), ctx.getGamePlayMask(), ctx.onResponseReceived)
     else:
         LOG_ERROR('Team is invalid', notValidReason)
         if callback:
             callback(False)
         SystemMessages.pushMessage(messages.getInvalidTeamMessage(notValidReason, functional=self), type=SystemMessages.SM_TYPE.Error)