コード例 #1
0
ファイル: base.py プロジェクト: nanxijw/Clara-Pretty-One-Dick
 def GetServiceStates(self, force=0):
     if not self.serviceItemsState or force:
         if util.IsOutpost(
                 eve.session.stationid) or sm.GetService('godma').GetType(
                     eve.stationItem.stationTypeID).isPlayerOwnable == 1:
             self.serviceItemsState = sm.RemoteSvc(
                 'corpStationMgr').GetStationServiceStates()
         else:
             self.serviceItemsState = {}
コード例 #2
0
    def CanInstallUpgrade(self, typeID, hubID, devIndices = None):
        if devIndices is None:
            devIndices = self.GetDevIndexMgr().GetDevelopmentIndicesForSystem(session.solarsystemid2)
        godma = sm.GetService('godma')
        for attributeID, data in devIndices.iteritems():
            value = godma.GetTypeAttribute(typeID, attributeID)
            level = self.GetDevIndexLevel(data.points)
            if value > 0 and value > level:
                return False

        sovInfo = self.GetSystemSovereigntyInfo(session.solarsystemid)
        sovereigntyLevel = int(godma.GetTypeAttribute(typeID, const.attributeDevIndexSovereignty, 0))
        sovHeldFor = (blue.os.GetWallclockTime() - sovInfo.claimTime) / const.DAY
        if util.GetTimeIndexLevelForDays(sovHeldFor) < sovereigntyLevel:
            return False
        requiredUpgradeID = int(godma.GetTypeAttribute(typeID, const.attributeSovUpgradeRequiredUpgradeID, 0))
        blockingUpgradeID = int(godma.GetTypeAttribute(typeID, const.attributeSovUpgradeBlockingUpgradeID, 0))
        if requiredUpgradeID > 0 or blockingUpgradeID > 0:
            inv = sm.GetService('invCache').GetInventoryFromId(hubID)
            found = False
            requiredUpgradeID == 0
            for upgrade in inv.List():
                if requiredUpgradeID > 0 and upgrade.typeID == requiredUpgradeID and upgrade.flagID == const.flagStructureActive:
                    found = True
                if blockingUpgradeID > 0 and upgrade.typeID == blockingUpgradeID:
                    return False

            if not found:
                return False
        outpostUpgradeLevel = int(godma.GetTypeAttribute(typeID, const.attributeSovUpgradeRequiredOutpostUpgradeLevel, 0))
        if outpostUpgradeLevel > 0:
            outpostID = None
            park = sm.GetService('michelle').GetBallpark()
            for ballID in park.globals:
                if ballID < 0:
                    continue
                slimitem = park.GetInvItem(ballID)
                if util.IsOutpost(ballID) and slimitem is not None:
                    ownerID = slimitem.ownerID
                    if ownerID in self.GetOutpostData(ballID).allianceCorpList:
                        outpostID = ballID
                    break

            if outpostID is None:
                return False
            if self.GetOutpostData(outpostID).upgradeLevel < outpostUpgradeLevel:
                return False
        return True
コード例 #3
0
    def PrimeCharacterDetails(self, characterDetails):
        primeOwners = set()
        primeLocations = set()
        primeTickers = set()
        for character in characterDetails:
            primeOwners.add(character.characterID)
            primeOwners.add(character.corporationID)
            if character.allianceID:
                primeOwners.add(character.allianceID)
            if character.stationID is not None and util.IsOutpost(
                    character.stationID):
                primeLocations.add(character.stationID)
            primeTickers.add(character.corporationID)

        cfg.eveowners.Prime(primeOwners)
        cfg.corptickernames.Prime(primeTickers)
        if len(primeLocations):
            cfg.evelocations.Prime(primeLocations)
コード例 #4
0
ファイル: base.py プロジェクト: nanxijw/Clara-Pretty-One-Dick
    def Exit(self, *args):
        if self.exitingstation:
            self.AbortUndock()
            return False
        viewSvc = sm.GetService('viewState')
        hangarView = viewSvc.GetView('hangar')
        if hangarView is not None:
            hangarView.StartExitAnimation()
            hangarView.StartExitAudio()
        if sm.GetService('actionObjectClientSvc').IsEntityUsingActionObject(
                session.charid):
            sm.GetService('actionObjectClientSvc').ExitActionObject(
                session.charid)
        if settings.user.suppress.Get('suppress.AskUndockInEnemySystem',
                                      None) is None:
            if cfg.mapSystemCache[session.solarsystemid2].securityStatus < 0.0:
                if util.IsOutpost(
                        session.stationid2) or sm.GetService('godma').GetType(
                            eve.stationItem.stationTypeID
                        ).isPlayerOwnable == 1:
                    try:
                        sm.GetService('corp').GetCorpStationManager(
                        ).DoStandingCheckForStationService(
                            const.stationServiceDocking)
                    except UserError as e:
                        sovHolderName = cfg.eveowners.Get(
                            eve.stationItem.ownerID).ownerName
                        if uicore.Message(
                                'AskUndockInEnemySystem',
                            {'sovHolderName': sovHolderName},
                                uiconst.YESNO,
                                suppress=uiconst.ID_YES) != uiconst.ID_YES:
                            return False

            else:
                facwarSvc = sm.GetService('facwar')
                if facwarSvc.IsFacWarSystem(session.solarsystemid2):
                    occupierID = facwarSvc.GetSystemOccupier(
                        session.solarsystemid2)
                    if facwarSvc.IsEnemyCorporation(session.corpid,
                                                    occupierID):
                        sovHolderName = cfg.eveowners.Get(occupierID).ownerName
                        if uicore.Message(
                                'AskUndockInEnemySystem',
                            {'sovHolderName': sovHolderName},
                                uiconst.YESNO,
                                suppress=uiconst.ID_YES) != uiconst.ID_YES:
                            return False
        if not IsOkToBoardWithModulesLackingSkills(
                sm.GetService('clientDogmaIM').GetDogmaLocation(),
                uicore.Message):
            return False
        systemSecStatus = sm.StartService('map').GetSecurityClass(
            eve.session.solarsystemid2)
        beenWarned = False
        if self.crimewatchSvc.IsCriminal(session.charid):
            if systemSecStatus == const.securityClassHighSec:
                beenWarned = True
                if eve.Message('UndockCriminalConfirm', {},
                               uiconst.YESNO) != uiconst.ID_YES:
                    return False
        if not beenWarned:
            if systemSecStatus > const.securityClassZeroSec:
                engagements = self.crimewatchSvc.GetMyEngagements()
                if len(engagements):
                    if eve.Message('UndockAggressionConfirm', {},
                                   uiconst.YESNO) != uiconst.ID_YES:
                        return False
        shipID = util.GetActiveShip()
        if shipID is None:
            shipID = self.ShipPicker()
            if shipID is None:
                eve.Message('NeedShipToUndock')
                return False
            sm.GetService('clientDogmaIM').GetDogmaLocation().MakeShipActive(
                shipID)
        if settings.user.suppress.Get('suppress.CourierUndockMissingCargo',
                                      None) is None:
            if not sm.GetService('journal').CheckUndock(session.stationid2):
                return False
        self.exitingstation = 1
        uthread.new(self.LoadSvc, None)
        uthread.new(self.Undock_Thread, shipID)
        return True
コード例 #5
0
    def Exit(self, *args):
        if self.exitingstation:
            return
        if sm.GetService('actionObjectClientSvc').IsEntityUsingActionObject(session.charid):
            sm.GetService('actionObjectClientSvc').ExitActionObject(session.charid)
        if settings.user.suppress.Get('suppress.AskUndockInEnemySystem', None) is None:
            if cfg.solarsystems.Get(session.solarsystemid2).security < 0.0:
                if util.IsOutpost(session.stationid2) or sm.GetService('godma').GetType(eve.stationItem.stationTypeID).isPlayerOwnable == 1:
                    try:
                        sm.GetService('corp').GetCorpStationManager().DoStandingCheckForStationService(const.stationServiceDocking)
                    except UserError as e:
                        sovHolderName = cfg.eveowners.Get(eve.stationItem.ownerID).ownerName
                        if uicore.Message('AskUndockInEnemySystem', {'sovHolderName': sovHolderName}, uiconst.YESNO, suppress=uiconst.ID_YES) != uiconst.ID_YES:
                            return

            else:
                facwarSvc = sm.GetService('facwar')
                if facwarSvc.IsFacWarSystem(session.solarsystemid2):
                    occupierID = facwarSvc.GetSystemOccupier(session.solarsystemid2)
                    if facwarSvc.IsEnemyCorporation(session.corpid, occupierID):
                        sovHolderName = cfg.eveowners.Get(occupierID).ownerName
                        if uicore.Message('AskUndockInEnemySystem', {'sovHolderName': sovHolderName}, uiconst.YESNO, suppress=uiconst.ID_YES) != uiconst.ID_YES:
                            return
        systemSecStatus = sm.StartService('map').GetSecurityClass(eve.session.solarsystemid2)
        beenWarned = False
        if self.crimewatchSvc.IsCriminal(session.charid):
            if systemSecStatus == const.securityClassHighSec:
                beenWarned = True
                if eve.Message('UndockCriminalConfirm', {}, uiconst.YESNO) != uiconst.ID_YES:
                    return
        if not beenWarned:
            if systemSecStatus > const.securityClassZeroSec:
                engagements = self.crimewatchSvc.GetMyEngagements()
                if len(engagements):
                    if eve.Message('UndockAggressionConfirm', {}, uiconst.YESNO) != uiconst.ID_YES:
                        return
        shipID = util.GetActiveShip()
        if shipID is None:
            shipID = self.ShipPicker()
            if shipID is None:
                eve.Message('NeedShipToUndock')
                return
            sm.GetService('clientDogmaIM').GetDogmaLocation().MakeShipActive(shipID)
        if settings.user.suppress.Get('suppress.CourierUndockMissingCargo', None) is None:
            if not sm.GetService('journal').CheckUndock(session.stationid2):
                return
        self.exitingstation = 1
        self.dockaborted = 0
        uthread.new(self.LoadSvc, None)
        msg = [(localization.GetByLabel('UI/Station/PrepareToUndock'), localization.GetByLabel('UI/Station/RequestingUndockPermission')),
         (localization.GetByLabel('UI/Station/PrepareToUndock'), localization.GetByLabel('UI/Station/WaitingForConfirmation')),
         (localization.GetByLabel('UI/Station/PrepareToUndock'), localization.GetByLabel('UI/Station/UndockingConfirmed')),
         (localization.GetByLabel('UI/Station/EnteringSpace'), localization.GetByLabel('UI/Station/PreparingShip')),
         (localization.GetByLabel('UI/Station/EnteringSpace'), localization.GetByLabel('UI/Station/ShipReady'))]
        minSleepTime = max(len(msg) * 1000, ((eve.session.nextSessionChange or 0.0) - blue.os.GetSimTime()) / (SEC / 1000)) / len(msg)
        for i in xrange(len(msg)):
            if self.dockaborted:
                self.exitingstation = 0
                break
            sm.GetService('loading').ProgressWnd(msg[i][0], msg[i][1], i + 1, len(msg) + 1, abortFunc=self.AbortUndock)
            blue.pyos.synchro.SleepSim(minSleepTime)

        blue.pyos.synchro.SleepSim(1000)
        if self.dockaborted:
            self.dockaborted = 0
            return
        sm.GetService('loading').ProgressWnd(msg[i][0], msg[i][1], i + 2, len(msg) + 1)
        self.UndockAttempt(shipID)