コード例 #1
0
ファイル: districtSvc.py プロジェクト: R4M80MrX/eve-1
    def _LoadTargetBalls(self):
        ballpark = self.michelle.GetBallpark()
        for targetID, target in self.targets.iteritems():
            district = self.districts.get(target['districtID'])
            if ballpark and district and district[
                    'planet'] and targetID not in self.balls:
                targetBall = self._CreateDistrictBall(district, targetID)
                header = [
                    'itemID', 'typeID', 'ownerID', 'groupID', 'categoryID',
                    'quantity', 'singleton', 'stacksize', 'locationID',
                    'flagID', 'charID', 'corpID', 'allianceID',
                    'securityStatus', 'jumps', 'orbitalState', 'planetID'
                ]
                targetItem = util.Row(header, [
                    targetBall.id, const.typeOrbitalTarget,
                    target['characterID'], const.groupOrbitalTarget,
                    const.categoryCelestial, 1, -1, 1, target['districtID'],
                    0, target['characterID'], target['corporationID'], None, 0,
                    [], None, None
                ])
                ballpark.slimItems[targetBall.id] = targetItem
                cfg.evelocations.Hint(targetBall.id, [
                    targetBall.id,
                    cfg.eveowners.Get(target['characterID']).name,
                    targetBall.x, targetBall.y, targetBall.z, None
                ])
                sm.GetService('target').OnTargetAdded(targetBall.id)

        self._CleanupBalls()
コード例 #2
0
 def GetTitlesListData(self):
     corporation = sm.GetService('corp').GetCorporation()
     IAmCEO = corporation.ceoID == eve.session.charid
     IAmDirector = [eve.session.corprole & const.corpRoleDirector,
                    0][IAmCEO]
     title = self.sr.node.srcRec
     roles = title.roles
     grantableRoles = title.grantableRoles
     rolesAtHQ = title.rolesAtHQ
     grantableRolesAtHQ = title.grantableRolesAtHQ
     rolesAtBase = title.rolesAtBase
     grantableRolesAtBase = title.grantableRolesAtBase
     rolesAtOther = title.rolesAtOther
     grantableRolesAtOther = title.grantableRolesAtOther
     isCEO = 0
     isDirector = 0
     grantableRoles = grantableRoles & ~const.corpRoleDirector
     roles = roles & ~const.corpRoleDirector
     line = [
         title.titleID, title.titleName,
         '%s' % title.titleName, roles,
         long(roles), grantableRoles,
         long(grantableRoles), rolesAtHQ,
         long(rolesAtHQ), grantableRolesAtHQ,
         long(grantableRolesAtHQ), rolesAtBase,
         long(rolesAtBase), grantableRolesAtBase,
         long(grantableRolesAtBase), rolesAtOther,
         long(rolesAtOther), grantableRolesAtOther,
         long(grantableRolesAtOther), isCEO, isDirector, IAmCEO, IAmDirector
     ]
     self.sr.node.rec = util.Row(self.sr.rowHeader, line)
     self.LogInfo(self.sr.node.rec)
コード例 #3
0
    def OnTitleChanged(self, corpID, titleID, change):
        try:
            if self.titles is None:
                return
            bAdd, bRemove = self.GetAddRemoveFromChange(change)
            key = titleID
            if bAdd:
                header = None
                for example in self.titles.itervalues():
                    header = example.header
                    break

                if header is None:
                    header = change.keys()
                line = []
                for columnName in header:
                    line.append(change[columnName][1])

                title = util.Row(header, line)
                self.titles[key] = title
            elif bRemove:
                if self.titles.has_key(key):
                    del self.titles[key]
            elif self.titles.has_key(key):
                title = self.titles[key]
                for columnName in change.iterkeys():
                    setattr(title, columnName, change[columnName][1])

                self.titles[key] = title
        finally:
            sm.GetService('corpui').OnTitleChanged(corpID, titleID, change)
コード例 #4
0
 def UpdateUI(self):
     wnd = self.GetWnd()
     if not wnd or wnd.destroyed:
         return
     hd, li = blue.pyos.ProbeStuff()
     info = util.Row(list(hd), li)
     virtualMem = info.pagefileUsage / 1024
     if self.lastVM is None:
         self.lastVM = virtualMem
     delta = virtualMem - self.lastVM
     self.totalVMDelta += delta
     self.lastVM = virtualMem
     delta = delta or self.lastVMDelta
     self.lastVMDelta = delta
     dc = ['<color=0xff00ff00>', '<color=0xffff0000>'][delta > 0]
     tdc = ['<color=0xff00ff00>',
            '<color=0xffff0000>'][self.totalVMDelta > 0]
     try:
         dev = trinity.device
         iml = ''
         if blue.logInMemory.isActive:
             iml = 'In-memory logging <color=0xff00ff00>active</color> (%s / %s)' % (
                 LOGTYPE_MAPPING.get(
                     blue.logInMemory.threshold,
                     ('Unknown', ''))[0], blue.logInMemory.capacity)
         fps = 'Fps: %.1f - %s' % (blue.os.fps, iml)
         if wnd.sr.fpsText.text != fps:
             wnd.sr.fpsText.text = fps
         vm = 'VM Size/D/TD: %sK / %s%sK<color=0xffffffff> / %s%sK<color=0xffb0b0b0> - totalVidMem: %sM' % (
             util.FmtAmt(virtualMem), dc, util.FmtAmt(delta), tdc,
             util.FmtAmt(self.totalVMDelta), self.totalVidMem)
         if wnd.sr.vmText.text != vm:
             wnd.sr.vmText.text = vm
         inUse = util.FmtAmt(blue.motherLode.memUsage / 1024)
         total = util.FmtAmt(blue.motherLode.maxMemUsage / 1024)
         num = blue.motherLode.size()
         vm = 'Resource Cache Usage: %sK / %sK - %s objects' % (inUse,
                                                                total, num)
         if wnd.sr.cacheText.text != vm:
             wnd.sr.cacheText.text = vm
         spaceMgr = sm.StartService('space')
         mo = 'Lazy Queue: %s' % getattr(spaceMgr, 'lazyLoadQueueCount', 0)
         if session.role & service.ROLEMASK_ELEVATEDPLAYER:
             mo += ' - Preload Queue: %s' % getattr(spaceMgr,
                                                    'preloadQueueCount', 22)
         if wnd.sr.queueText.text != mo:
             wnd.sr.queueText.text = mo
     except Exception as e:
         print 'e', e
         self.uitimer = None
         sys.exc_clear()
コード例 #5
0
ファイル: corp_ui_accounts.py プロジェクト: R4M80MrX/eve-1
    def ShowLockdownSubcontent(self, nodedata, *args):
        scrolllist = []
        items = sm.GetService('corp').GetLockedItemsByLocation(nodedata.locationID)
        locationID = nodedata.locationID
        offices = sm.GetService('corp').GetMyCorporationsOffices().SelectByUniqueColumnValues('stationID', [locationID])
        if offices and len(offices):
            for office in offices:
                if locationID == office.stationID:
                    locationID = office.officeID

        header = ['itemID',
         'typeID',
         'ownerID',
         'groupID',
         'categoryID',
         'quantity',
         'singleton',
         'stacksize',
         'locationID',
         'flagID']
        for it in items.itervalues():
            typeInfo = cfg.invtypes.Get(it.typeID)
            line = [it.itemID,
             it.typeID,
             eve.session.corpid,
             typeInfo.groupID,
             typeInfo.categoryID,
             1,
             const.singletonBlueprintOriginal,
             1,
             locationID,
             4]
            fakeItem = util.Row(header, line)
            data = uix.GetItemData(fakeItem, self.sr.viewMode, viewOnly=1, scrollID=nodedata.scrollID)
            data.GetMenu = self.OnGetEmptyMenu
            scrolllist.append(listentry.Get('InvItem', data))

        return scrolllist
コード例 #6
0
    def GetMembersListData(self):
        corporation = sm.GetService('corp').GetCorporation()
        IAmCEO = corporation.ceoID == eve.session.charid
        IAmDirector = [eve.session.corprole & const.corpRoleDirector,
                       0][IAmCEO]
        member = self.sr.node.srcRec
        roles = member.roles
        grantableRoles = member.grantableRoles
        rolesAtHQ = member.rolesAtHQ
        grantableRolesAtHQ = member.grantableRolesAtHQ
        rolesAtBase = member.rolesAtBase
        grantableRolesAtBase = member.grantableRolesAtBase
        rolesAtOther = member.rolesAtOther
        grantableRolesAtOther = member.grantableRolesAtOther
        baseID = member.baseID
        titleMask = member.titleMask
        isCEO = 0
        isDirector = 0
        isCEO = member.characterID == corporation.ceoID
        isDirector = roles & const.corpRoleDirector == const.corpRoleDirector
        if isCEO or isDirector:
            roles = 0
            for roleGrouping in self.sr.roleGroupings.itervalues():
                appliesTo = roleGrouping.appliesTo
                appliesToGrantable = roleGrouping.appliesToGrantable
                if appliesTo == 'roles':
                    roles |= roleGrouping.roleMask
                elif appliesTo == 'rolesAtHQ':
                    rolesAtHQ |= roleGrouping.roleMask
                elif appliesTo == 'rolesAtBase':
                    rolesAtBase |= roleGrouping.roleMask
                elif appliesTo == 'rolesAtOther':
                    rolesAtOther |= roleGrouping.roleMask
                if appliesToGrantable == 'grantableRoles':
                    grantableRoles |= roleGrouping.roleMask
                elif appliesToGrantable == 'grantableRolesAtHQ':
                    grantableRolesAtHQ |= roleGrouping.roleMask
                elif appliesToGrantable == 'grantableRolesAtBase':
                    grantableRolesAtBase |= roleGrouping.roleMask
                elif appliesToGrantable == 'grantableRolesAtOther':
                    grantableRolesAtOther |= roleGrouping.roleMask

            if isDirector:
                grantableRoles = grantableRoles & ~const.corpRoleDirector
        oldBaseID = baseID
        if oldBaseID is not None:
            oldBaseID = long(baseID)
        line = [
            member.characterID,
            cfg.eveowners.Get(member.characterID).ownerName, roles,
            long(roles), grantableRoles,
            long(grantableRoles), rolesAtHQ,
            long(rolesAtHQ), grantableRolesAtHQ,
            long(grantableRolesAtHQ), rolesAtBase,
            long(rolesAtBase), grantableRolesAtBase,
            long(grantableRolesAtBase), rolesAtOther,
            long(rolesAtOther), grantableRolesAtOther,
            long(grantableRolesAtOther), baseID, oldBaseID, titleMask,
            int(titleMask), isCEO, isDirector, IAmCEO, IAmDirector
        ]
        self.sr.node.rec = util.Row(self.sr.rowHeader, line)
        self.LogInfo(self.sr.node.rec)
コード例 #7
0
import util
import sys
import uiconst
import log
import localization
import inventoryFlagsCommon
import uiutil
import telemetry

LOOT_GROUPS = (const.groupWreck, const.groupCargoContainer,
               const.groupSecureCargoContainer,
               const.groupAuditLogSecureContainer, const.groupFreightContainer,
               const.groupSpawnContainer,
               const.groupDeadspaceOverseersBelongings,
               const.groupMissionContainer)
ZERO_CAPACITY = util.Row(['capacity', 'used'], [0, 0.0])


class BaseInvContainer():
    __guid__ = 'invCtrl.BaseInvContainer'
    name = ''
    iconName = 'ui_3_64_13'
    locationFlag = None
    hasCapacity = False
    oneWay = False
    viewOnly = False
    scope = None
    isLockable = True
    filtersEnabled = True
    typeID = None
コード例 #8
0
ファイル: eve.py プロジェクト: R4M80MrX/eve-1
 def SetStationItemBits(self, bits):
     self.__stationItem = util.Row([
         'hangarGraphicID', 'ownerID', 'itemID', 'serviceMask',
         'stationTypeID'
     ], bits)