Exemplo n.º 1
0
 def unloadTankman(self, tmanInvID, currentVehicleID):
     tankman = g_itemsCache.items.getTankman(int(tmanInvID))
     tmanVehicle = g_itemsCache.items.getVehicle(int(tankman.vehicleInvID))
     if tmanVehicle is None:
         LOG_ERROR("Target tankman's vehicle is not found in inventory", tankman, tankman.vehicleInvID)
         return 
     unloader = TankmanUnload(tmanVehicle, tankman.vehicleSlotIdx)
     result = yield unloader.request()
     if len(result.userMsg):
         SystemMessages.g_instance.pushI18nMessage(result.userMsg, type=result.sysMsgType)
Exemplo n.º 2
0
 def unloadTankman(self, tmanInvID, currentVehicleID):
     tankman = g_itemsCache.items.getTankman(int(tmanInvID))
     tmanVehicle = g_itemsCache.items.getVehicle(int(tankman.vehicleInvID))
     if tmanVehicle is None:
         LOG_ERROR("Target tankman's vehicle is not found in inventory",
                   tankman, tankman.vehicleInvID)
         return
     unloader = TankmanUnload(tmanVehicle, tankman.vehicleSlotIdx)
     result = yield unloader.request()
     if len(result.userMsg):
         SystemMessages.g_instance.pushI18nMessage(result.userMsg,
                                                   type=result.sysMsgType)
Exemplo n.º 3
0
 def unloadTankman(self, tmanInvID):
     tankman = g_itemsCache.items.getTankman(int(tmanInvID))
     result = yield TankmanUnload(g_currentVehicle.item,
                                  tankman.vehicleSlotIdx).request()
     if len(result.userMsg):
         SystemMessages.g_instance.pushI18nMessage(result.userMsg,
                                                   type=result.sysMsgType)
Exemplo n.º 4
0
 def unloadTankman(self):
     tankman = self.itemsCache.items.getTankman(self._tankmanID)
     result = yield TankmanUnload(g_currentVehicle.item,
                                  tankman.vehicleSlotIdx).request()
     if result.userMsg:
         SystemMessages.pushI18nMessage(result.userMsg,
                                        type=result.sysMsgType)
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 def unloadTankman(self, invID):
     tankman = g_itemsCache.items.getTankman(int(invID))
     if tankman is None:
         LOG_ERROR('Attempt to dismiss tankman by invalid invID')
         return
     else:
         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()
         if len(result.userMsg):
             SystemMessages.g_instance.pushI18nMessage(result.userMsg, type=result.sysMsgType)
         return
Exemplo n.º 7
0
 def unloadTankman(self, dataCompact):
     tmanOldItem = getItemByCompact(dataCompact)
     if tmanOldItem is None:
         LOG_ERROR('Attempt to unload tankman by invalid compact')
         return
     else:
         tankman = g_itemsCache.items.getTankman(tmanOldItem.inventoryId)
         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()
         if len(result.userMsg):
             SystemMessages.g_instance.pushI18nMessage(
                 result.userMsg, type=result.sysMsgType)
         return
Exemplo n.º 8
0
 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
Exemplo n.º 9
0
 def unloadCrew():
     result = yield TankmanUnload(g_currentVehicle.item).request()
     if len(result.userMsg):
         SystemMessages.pushI18nMessage(result.userMsg,
                                        type=result.sysMsgType)
Exemplo n.º 10
0
 def unloadAllTankman(self):
     result = yield TankmanUnload(g_currentVehicle.item).request()
     if len(result.userMsg):
         SystemMessages.g_instance.pushI18nMessage(result.userMsg,
                                                   type=result.sysMsgType)