def _setPlayerReady(self, ctx, callback=None): if g_currentVehicle.isObserver(): if not self._processValidationResult(ctx, ValidationResult(False, PREBATTLE_RESTRICTION.VEHICLE_NOT_SUPPORTED)): if callback: callback(False) return super(TrainingEntity, self)._setPlayerReady(ctx, callback)
def _setPlayerReady(self, ctx, callback = None): """ Sets player state to ready. Args: ctx: set player state request context callback: operation callback """ if prb_getters.isParentControlActivated(): g_eventDispatcher.showParentControlNotification() if callback: callback(False) return if g_currentVehicle.isObserver(): if not self._processValidationResult(ctx, ValidationResult(False, PREBATTLE_RESTRICTION.VEHICLE_NOT_SUPPORTED)): if callback: callback(False) return if ctx.doVehicleValidation(): result = self._limits.isVehicleValid() if not self._processValidationResult(ctx, result): if callback: callback(False) return rosterKey = self.getRosterKey() team, assigned = decodeRoster(rosterKey) if assigned and self.getTeamState(team=team).isInQueue(): LOG_ERROR('Account assigned and team is ready or locked') if callback: callback(False) return ctx.startProcessing(callback) BigWorld.player().prb_ready(ctx.getVehicleInventoryID(), ctx.onResponseReceived)
def check(self, teamLimits): isValid, restriction = super(TrainingVehicleIsValid, self).check(teamLimits) return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_SUPPORTED ) if isValid and g_currentVehicle.isObserver() else ( isValid, restriction)