示例#1
0
 def Init(self):
     planet.BasePlanet.Init(self)
     self.ticking = False
     self.tickThread = None
     self.remoteHandler = moniker.GetPlanet(self.planetID)
     self.PreparePlanet()
     self.changes = planet.CommandStream()
     self.commandPinChange = CP_NOCHANGE
     self.backupData = None
     self.enteredEditModeTime = None
     self.isInEditMode = False
示例#2
0
 def GetPlanetCommandPins(self, planetID):
     pinData = self.commandPinsByPlanet.get(planetID, None)
     if pinData is None or pinData.timestamp + planetCommon.PLANET_CACHE_TIMEOUT < blue.os.GetWallclockTime(
     ):
         self.LogInfo(
             'GetPlanetCommandPins :: Fetching fresh data due to lack of data or expired timestamp for planet',
             planetID)
         remotePlanet = moniker.GetPlanet(planetID)
         pinData = util.KeyVal(timestamp=blue.os.GetWallclockTime())
         pinData.data = remotePlanet.GetCommandPinsForPlanet(planetID)
         self.commandPinsByPlanet[planetID] = pinData
     return pinData.data
示例#3
0
 def GetExtractorsForPlanet(self, planetID):
     extractorData = self.extractorsByPlanet.get(planetID, None)
     if extractorData is None or extractorData.timestamp + planetCommon.PLANET_CACHE_TIMEOUT < blue.os.GetWallclockTime(
     ):
         self.LogInfo(
             'GetPlanetExtractors :: Fetching fresh data due to lack of data or expired timestamp for planet',
             planetID)
         remotePlanet = moniker.GetPlanet(planetID)
         extractorData = util.KeyVal(timestamp=blue.os.GetWallclockTime())
         extractorData.data = remotePlanet.GetExtractorsForPlanet(planetID)
         self.extractorsByPlanet[planetID] = extractorData
     return extractorData.data
示例#4
0
 def GetColonyForCharacter(self, planetID, characterID):
     if planetID not in self.foreignColoniesByPlanet:
         self.foreignColoniesByPlanet[planetID] = {}
     colonyData = self.foreignColoniesByPlanet[planetID].get(
         characterID, None)
     if colonyData is None or colonyData.timestamp + planetCommon.PLANET_CACHE_TIMEOUT < blue.os.GetWallclockTime(
     ):
         self.LogInfo(
             'GetColonyForCharacter :: Fetching fresh data due to lack of colony or expired timestamp for planet',
             planetID, 'character', characterID)
         remotePlanet = moniker.GetPlanet(planetID)
         colonyData = util.KeyVal(timestamp=blue.os.GetWallclockTime())
         colonyData.data = remotePlanet.GetFullNetworkForOwner(
             planetID, characterID)
         self.foreignColoniesByPlanet[planetID][characterID] = colonyData
     return colonyData.data
示例#5
0
    def CanEnter(self, planetID=None, **kwargs):
        canEnter = True
        if planetID is None:
            self.LogInfo('Must have a valid planetID to open planet view')
            canEnter = False
        elif self.IsActive() and planetID == sm.GetService(
                'planerUI').planetID:
            self.LogInfo('Planet', planetID, 'is already open and loaded')
            canEnter = False
        if canEnter:
            try:
                remoteHandler = moniker.GetPlanet(planetID)
                remoteHandler.GetPlanetInfo()
            except UserError as e:
                eve.Message(*e.args)
                canEnter = False

        return canEnter