Exemplo n.º 1
0
    def Unload(self):
        BaseDogmaItem.Unload(self)
        if self.location:
            try:
                locationFittedItems = self.location.fittedItems
            except AttributeError:
                return

            if self.itemID in locationFittedItems:
                del locationFittedItems[self.itemID]
        elif self.itemID in self.dogmaLocation.itemsMissingLocation:
            del self.dogmaLocation.itemsMissingLocation[self.itemID]
Exemplo n.º 2
0
    def _FlushEffects(self):
        stackTraceCount = 0
        for fittedItem in self.fittedItems.itervalues():
            try:
                if fittedItem.itemID == self.itemID:
                    continue
                stackTraceCount += fittedItem.FlushEffects()
            except ReferenceError as e:
                self.broker.LogWarn(
                    'Failed to _FlushEffects for a fitted dogmaitem that is no longer around - we should have cleaned this up'
                )
                log.LogException(channel='svc.dogmaIM')
                sys.exc_clear()

        stackTraceCount += BaseDogmaItem._FlushEffects(self)
        return stackTraceCount
Exemplo n.º 3
0
    def Unload(self):
        BaseDogmaItem.Unload(self)
        self.dogmaLocation.LogInfo('LocationDogmaItem unloading subLocations')
        for itemKey in self.subLocations.values():
            self.dogmaLocation.UnloadItem(itemKey)

        if self in self.subLocations:
            self.subLocations.remove(self)
        self.dogmaLocation.LogInfo('LocationDogmaItem unloading fittedItems')
        for itemKey in self.fittedItems.keys():
            self.dogmaLocation.UnloadItem(itemKey)

        if self.itemID in self.fittedItems:
            del self.fittedItems[self.itemID]
        if self.itemID in self.dogmaLocation.moduleListsByShipGroup:
            del self.dogmaLocation.moduleListsByShipGroup[self.itemID]
        if self.itemID in self.dogmaLocation.moduleListsByShipType:
            del self.dogmaLocation.moduleListsByShipType[self.itemID]
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     self._location = None
     self.lastStopTime = None
     BaseDogmaItem.__init__(self, *args, **kwargs)
Exemplo n.º 5
0
 def UnpackPropagationData(self, propData, charID, shipID):
     BaseDogmaItem.UnpackPropagationData(self, propData, charID, shipID)
     self.SetLastStopTime(propData.lastStopTime)
Exemplo n.º 6
0
 def SerializeForPropagation(self):
     retVal = BaseDogmaItem.SerializeForPropagation(self)
     retVal.lastStopTime = self.lastStopTime
     return retVal
Exemplo n.º 7
0
 def OnItemLoaded(self):
     self.dogmaLocation.LoadItemsInLocation(self.itemID)
     self.dogmaLocation.LoadSublocations(self.itemID)
     BaseDogmaItem.OnItemLoaded(self)
Exemplo n.º 8
0
 def __init__(self, dogmaLocation, item, eveCfg, clientIDFunc):
     BaseDogmaItem.__init__(self, dogmaLocation, item, eveCfg, clientIDFunc)
     self.fittedItems = {}
     self.subLocations = {}
Exemplo n.º 9
0
 def GetPersistables(self):
     ret = BaseDogmaItem.GetPersistables(self)
     ret.update(self.fittedItems.keys())
     return ret