Beispiel #1
0
 def _PrepareBackgroundLandscapes(self,
                                  scene,
                                  solarSystemID,
                                  constellationID=None):
     starSeed = 0
     securityStatus = 1
     if constellationID is None:
         constellationID = sm.GetService(
             'map').GetConstellationForSolarSystem(solarSystemID)
     if bool(solarSystemID) and bool(constellationID):
         starSeed = int(constellationID)
         securityStatus = sm.GetService('map').GetSecurityStatus(
             solarSystemID)
     if not gfxutils.BlockStarfieldOnLionOSX():
         scene.starfield = self._GetSharedResource(
             'res:/dx9/scene/starfield/spritestars.red')
         if scene.starfield is not None:
             scene.starfield.seed = starSeed
             scene.starfield.minDist = 40
             scene.starfield.maxDist = 80
             if util.IsWormholeSystem(solarSystemID):
                 scene.starfield.numStars = 0
             else:
                 scene.starfield.numStars = 500 + int(250 * securityStatus)
     if scene.backgroundEffect is None:
         scene.backgroundEffect = self._GetSharedResource(
             'res:/dx9/scene/starfield/starfieldNebula.red')
         node = nodemanager.FindNode(scene.backgroundEffect.resources,
                                     'NebulaMap',
                                     'trinity.TriTexture2DParameter')
         if node is not None:
             node.resourcePath = scene.envMap1ResPath
     scene.backgroundRenderingEnabled = True
Beispiel #2
0
 def UpdateHeaderText(self):
     starMapSvc = sm.GetService('starmap')
     destination = starMapSvc.GetDestination()
     routeData = starMapSvc.GetAutopilotRoute()
     if self.mode == infoPanelConst.MODE_NORMAL:
         numJumps = self._GetNumJumps(routeData)
         if not destination:
             subHeader = ''
         elif util.IsWormholeSystem(session.solarsystemid2):
             if numJumps <= 1:
                 subHeader = localization.GetByLabel(
                     'UI/Market/MarketQuote/UnknownNumberOfJumps')
             else:
                 subHeader = localization.GetByLabel(
                     'UI/Market/MarketQuote/MinimumPossibleNumberOfJumps',
                     num=numJumps)
         else:
             subHeader = localization.GetByLabel(
                 'UI/Market/MarketQuote/NumberOfJumps', num=numJumps)
         self.header.text = '<color=white>%s <fontsize=12></b>%s' % (
             localization.GetByLabel('UI/InfoWindow/TabNames/Route'),
             subHeader)
     elif routeData:
         self.headerCompact.text = _GetCurrentDestinationLabel(routeData[0])
     else:
         destination = starMapSvc.GetDestination()
         self.headerCompact.text = _GetCurrentDestinationLabel(destination)
Beispiel #3
0
 def ShowTutorialAgents(self, fromWhere='', *args):
     if util.IsWormholeSystem(
             eve.session.solarsystemid
     ) or eve.session.solarsystemid == const.solarSystemPolaris:
         raise UserError('NoAgentsInWormholes')
     sm.StartService('tutorial').ShowCareerFunnel()
     self.LogHelpWindowEvents('openCareerFunnel', fromWhere)
Beispiel #4
0
 def PrepareBackgroundLandscapes(self, scene):
     starSeed = 0
     securityStatus = 1
     if eve.session.stationid is not None:
         return
     if scene is None:
         return
     if bool(eve.session.solarsystemid2):
         starSeed = int(eve.session.constellationid)
         securityStatus = sm.StartService('map').GetSecurityStatus(
             eve.session.solarsystemid)
     scene.starfield = trinity.Load(
         'res:/dx9/scene/starfield/spritestars.red')
     if scene.starfield is not None:
         scene.starfield.seed = starSeed
         scene.starfield.minDist = 40
         scene.starfield.maxDist = 80
         if util.IsWormholeSystem(eve.session.solarsystemid):
             scene.starfield.numStars = 0
         else:
             scene.starfield.numStars = 500 + int(250 * securityStatus)
     if scene.backgroundEffect is None:
         scene.backgroundEffect = trinity.Load(
             'res:/dx9/scene/starfield/starfieldNebula.red')
         node = nodemanager.FindNode(scene.backgroundEffect.resources,
                                     'NebulaMap',
                                     'trinity.TriTexture2DParameter')
         if node is not None:
             node.resourcePath = scene.envMap1ResPath
     if scene.starfield is None or scene.backgroundEffect is None:
         return
     scene.backgroundRenderingEnabled = True
Beispiel #5
0
def IsMemberlessLocal(channelID):
    if type(channelID) != types.IntType:
        if type(channelID[0]) == types.TupleType:
            channelID = channelID[0]
        if channelID[0] == 'solarsystemid2':
            if util.IsWormholeSystem(channelID[1]):
                return True
    return False
Beispiel #6
0
 def OnLoadScene(self, scene, key):
     if key != 'default':
         self.systemID = None
         return
     systemID = session.solarsystemid
     if util.IsWormholeSystem(systemID):
         return
     if not self.model:
         self._LoadModel()
     self.UpdatePosition()
     self.AddToScene(scene, systemID)
 def GetNeighbors(self, itemID):
     if util.IsWormholeSystem(itemID) or util.IsWormholeConstellation(itemID) or util.IsWormholeRegion(itemID):
         return []
     if util.IsSolarSystem(itemID):
         solarSystem = cfg.mapSystemCache.Get(itemID)
         return [ i.solarSystemID for i in solarSystem.neighbours ]
     if util.IsConstellation(itemID):
         constellation = cfg.mapConstellationCache.Get(itemID)
         return constellation.neighbours
     if util.IsRegion(itemID):
         region = cfg.mapRegionCache.Get(itemID)
         return region.neighbours
     return []
Beispiel #8
0
 def GetCurrentData(self, locationID):
     fwData = {}
     if util.IsSolarSystem(locationID) and not util.IsWormholeSystem(locationID):
         constellationID = sm.GetService('map').GetParent(locationID)
         data = sm.RemoteSvc('map').GetCurrentSovData(constellationID)
         indexedData = data.Index('locationID')
         sovData = [indexedData[locationID]]
         fwData = sm.RemoteSvc('map').GetConstellationLPData(constellationID).Index('solarSystemID')
     else:
         if util.IsConstellation(locationID):
             fwData = sm.RemoteSvc('map').GetConstellationLPData(locationID).Index('solarSystemID')
         sovData = sm.RemoteSvc('map').GetCurrentSovData(locationID)
     return (sovData, fwData)
Beispiel #9
0
def IsMemberlessLocal(channelID):
    """
        This utility function is used by the server and the client
        to know if channelID is a local channel in 'memberless' mode.
        Currently this is the case in wormhole systems only
    """
    if type(channelID) != types.IntType:
        if type(channelID[0]) == types.TupleType:
            channelID = channelID[0]
        if channelID[0] == 'solarsystemid2':
            if util.IsWormholeSystem(channelID[1]):
                return True
    return False
Beispiel #10
0
 def GetNeighbors(self, itemID):
     if util.IsWormholeSystem(itemID) or util.IsWormholeConstellation(
             itemID) or util.IsWormholeRegion(itemID):
         return []
     cache = self.GetMapCache()
     if itemID in cache['neighbors']:
         return cache['neighbors'][itemID]
     item = self.GetItem(itemID, 1)
     ssitem = item.item
     if ssitem.groupID == const.typeSolarSystem:
         return [locID for jumpgroup in item.jumps for locID in jumpgroup]
     else:
         return []
Beispiel #11
0
 def MoveItemsInStructureToAssetSafetyForCorp(self, solarSystemID,
                                              structureID):
     if util.IsWormholeSystem(solarSystemID):
         label = 'ConfirmAssetEjectionCorp'
     else:
         label = 'ConfirmAssetSafetyCorp'
     if eve.Message(
             label, {
                 'corpName': cfg.eveowners.Get(session.corpid).name,
                 'structureID': structureID,
                 'solarsystemID': solarSystemID
             }, uiconst.YESNO) == uiconst.ID_YES:
         sm.RemoteSvc('structureAssetSafety').MoveCorpAssetsToSafety(
             solarSystemID, structureID)
Beispiel #12
0
    def CreateResourceInfo(self, resourceTypeID, entry):
        info = util.KeyVal(resourceTypeID=resourceTypeID,
                           updateTime=entry.updateTime,
                           oldBand=entry.numBands,
                           planetology=0,
                           advancedPlanetology=0,
                           remoteSensing=0)
        planetInfo = sm.GetService('map').GetPlanetInfo(self.planetID)
        planetLoc = cfg.evelocations.Get(planetInfo.solarSystemID)
        planetPos = (planetLoc.x, planetLoc.y, planetLoc.z)
        playerLoc = cfg.evelocations.Get(session.solarsystemid2)
        playerPos = (playerLoc.x, playerLoc.y, playerLoc.z)
        dist = geo2.Vec3Distance(playerPos, planetPos) / const.LIGHTYEAR
        skills = sm.GetService('skills').MySkillLevelsByID(renew=True)
        info.remoteSensing = skills.get(const.typeRemoteSensing, 0)
        if info.remoteSensing == 0:
            info.skillMissing = True
            return info
        if session.solarsystemid2 == planetInfo.solarSystemID or sm.GetService(
                'planetSvc').IsPlanetColonizedByMe(self.planetID):
            info.proximity = const.planetResourceProximityPlanet
        else:
            if util.IsWormholeSystem(session.solarsystemid2) or sm.GetService(
                    'pathfinder').GetJumpCountFromCurrent(
                        planetInfo.solarSystemID) > 1000:
                info.unreachableSystem = True
                return info
            info.proximity = None
            for i, scanRange in enumerate(const.planetResourceScanningRanges):
                if scanRange >= dist:
                    info.proximity = i

            if info.proximity is None or dist > const.planetResourceScanningRanges[
                    5 - info.remoteSensing]:
                info.systemOutOfRange = True
                info.systemDistance = dist
                info.maxScanDistance = const.planetResourceScanningRanges[
                    5 - info.remoteSensing]
                return info
        info.planetology = skills.get(const.typePlanetology, 0)
        info.advancedPlanetology = skills.get(const.typeAdvancedPlanetology, 0)
        minBand, maxBand = const.planetResourceProximityLimits[info.proximity]
        info.newBand = min(
            maxBand, minBand + info.planetology + info.advancedPlanetology * 2)
        requiredSkill = 5 - info.proximity
        if info.remoteSensing < requiredSkill:
            info.requiredSkill = requiredSkill
        return info
Beispiel #13
0
 def GetMenuLocationMenu(self, node):
     locationID = node.location.locationID
     solarSystemID, stationTypeID = self.GetStationSolarSystemIDAndTypeID(
         node)
     menu = sm.StartService('menu').CelestialMenu(node.location.locationID,
                                                  typeID=stationTypeID,
                                                  parentID=solarSystemID)
     if not util.IsStation(locationID):
         if session.structureid != locationID:
             if util.IsWormholeSystem(solarSystemID):
                 label = MenuLabel(
                     'UI/Inventory/AssetSafety/MoveItemsToSpace')
             else:
                 label = MenuLabel(
                     'UI/Inventory/AssetSafety/MoveItemsToSafety')
             menu.append((label, self.MoveItemsInStructureToAssetSafety,
                          (solarSystemID, locationID)))
     return menu
Beispiel #14
0
 def _PrepareBackgroundLandscapes(self,
                                  scene,
                                  solarSystemID,
                                  constellationID=None):
     starSeed = 0
     securityStatus = 1
     if constellationID is None:
         constellationID = sm.GetService(
             'map').GetConstellationForSolarSystem(solarSystemID)
     if bool(solarSystemID) and bool(constellationID):
         starSeed = int(constellationID)
         securityStatus = sm.GetService('map').GetSecurityStatus(
             solarSystemID)
     scene.starfield = self._GetSharedResource(
         'res:/dx9/scene/starfield/spritestars.red')
     if scene.starfield is not None:
         scene.starfield.seed = starSeed
         scene.starfield.minDist = 40
         scene.starfield.maxDist = 80
         if util.IsWormholeSystem(solarSystemID):
             scene.starfield.numStars = 0
         else:
             scene.starfield.numStars = 500 + int(250 * securityStatus)
Beispiel #15
0
 def MoveItemsInStructureToAssetSafetyForCharacter(self, solarSystemID,
                                                   structureID):
     if IsControllingStructure() and session.shipid == structureID:
         raise UserError('CannotPutItemsInSafetyWhileControllingStructure')
     itemsAtStructureExceptCurrentShip = [
         item for item in sm.GetService('invCache').GetInventory(
             const.containerGlobal).ListStationItems(structureID)
         if item.itemID != session.shipid
     ]
     if 0 < len(itemsAtStructureExceptCurrentShip):
         if util.IsWormholeSystem(solarSystemID):
             label = 'ConfirmAssetEjectionCharacter'
         else:
             label = 'ConfirmAssetSafetyCharacter'
         if eve.Message(label, {
                 'structureID': structureID,
                 'solarsystemID': solarSystemID
         }, uiconst.YESNO) == uiconst.ID_YES:
             sm.RemoteSvc(
                 'structureAssetSafety').MovePersonalAssetsToSafety(
                     solarSystemID, structureID)
     else:
         raise UserError('NoItemsToPutInAssetSafety')
Beispiel #16
0
 def GetLocationMenu(self, node):
     locationID = node.locationID
     if util.IsStation(locationID) or self.IsLocationStructure(node):
         if util.IsStation(locationID):
             stationInfo = sm.GetService('ui').GetStation(locationID)
             typeID = stationInfo.stationTypeID
         else:
             typeID = node.locationTypeID
         solarSystemID = node.solarSystemID
         menu = sm.GetService('menu').CelestialMenu(locationID, typeID=typeID, parentID=solarSystemID)
         checkIsDirector = self.IsDirector()
         if checkIsDirector:
             if node.flag == FLAG_JUNK:
                 menu.append((MenuLabel('UI/Corporations/Assets/TrashItemsAtLocation'), self.TrashJunkAtLocation, (locationID,)))
             if self.IsLocationStructure(node):
                 if util.IsWormholeSystem(solarSystemID):
                     label = MenuLabel('UI/Inventory/AssetSafety/MoveItemsToSpace')
                 else:
                     label = MenuLabel('UI/Inventory/AssetSafety/MoveItemsToSafety')
                 menu.append((label, self.MoveItemsToSafety, (solarSystemID, locationID)))
         return menu
     if util.IsSolarSystem(locationID):
         return sm.GetService('menu').CelestialMenu(locationID)
     return []
Beispiel #17
0
 def ShowTutorialAgents(self, *args):
     if util.IsWormholeSystem(
             eve.session.solarsystemid
     ) or eve.session.solarsystemid == const.solarSystemPolaris:
         raise UserError('NoAgentsInWormholes')
     sm.StartService('tutorial').ShowCareerFunnel()
Beispiel #18
0
 def IterateKnownSpaceSolarSystems(self):
     for systemID, system in cfg.mapSystemCache.iteritems():
         if not util.IsWormholeSystem(systemID):
             yield (systemID, system)
 def IsUnreachable(self):
     return bool(not util.IsWormholeSystem(self.searchedSystem) and self.pathFinder.GetJumpCount(self.team.solarSystemID, self.searchedSystem) > 1000)