def dismissTankman(self, tmanInvID): tankman = g_itemsCache.items.getTankman(int(tmanInvID)) proc = TankmanDismiss(tankman) result = yield proc.request() if len(result.userMsg): SystemMessages.g_instance.pushMessage(result.userMsg, type=result.sysMsgType)
def actTankman(self, invID): if self.filter[ 'location'] != BARRACKS_CONSTANTS.LOCATION_FILTER_NOT_RECRUITED: tankman = self.itemsCache.items.getTankman(int(invID)) if tankman is None: _logger.error( 'Attempt to dismiss tankman by invalid invID: %r', invID) return if tankman.isDismissed: result = yield TankmanRestore(tankman).request() elif tankman.isInTank: tmanVehile = self.itemsCache.items.getVehicle( tankman.vehicleInvID) if tmanVehile is None: _logger.error( "Target tankman's vehicle is not found in inventory %r %r", tankman, tankman.vehicleInvID) return result = yield TankmanUnload(tmanVehile, tankman.vehicleSlotIdx).request() else: result = yield TankmanDismiss(tankman).request() if result.userMsg: SystemMessages.pushMessage(result.userMsg, type=result.sysMsgType) return
def dismissTankman(self, invID): tankman = g_itemsCache.items.getTankman(int(invID)) if tankman is None: LOG_ERROR('Attempt to dismiss tankman by invalid invID') return result = yield TankmanDismiss(tankman).request() if len(result.userMsg): SystemMessages.g_instance.pushMessage(result.userMsg, type=result.sysMsgType)
def dismissTankman(self, dataCompact): tmanOldItem = getItemByCompact(dataCompact) if tmanOldItem is None: LOG_ERROR('Attempt to dismiss tankman by invalid compact') return else: tankman = g_itemsCache.items.getTankman(tmanOldItem.inventoryId) result = yield TankmanDismiss(tankman).request() if len(result.userMsg): SystemMessages.g_instance.pushMessage(result.userMsg, type=result.sysMsgType) return
def actTankman(self, invID): tankman = g_itemsCache.items.getTankman(int(invID)) if tankman is None: LOG_ERROR('Attempt to dismiss tankman by invalid invID:', invID) return else: if tankman.isDismissed: result = yield TankmanRestore(tankman).request() elif tankman.isInTank: tmanVehile = g_itemsCache.items.getVehicle(tankman.vehicleInvID) if tmanVehile is None: LOG_ERROR("Target tankman's vehicle is not found in inventory", tankman, tankman.vehicleInvID) return result = yield TankmanUnload(tmanVehile, tankman.vehicleSlotIdx).request() else: result = yield TankmanDismiss(tankman).request() if len(result.userMsg): SystemMessages.pushMessage(result.userMsg, type=result.sysMsgType) return
def dismissTankman(self, tmanInvID): tankman = self.__getTankmanByInvID(int(tmanInvID)) proc = TankmanDismiss(tankman) result = yield proc.request() SystemMessages.pushMessages(result)