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 = Row(self.sr.rowHeader, line)
     self.LogInfo(self.sr.node.rec)
Exemplo n.º 2
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 = 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)
Exemplo n.º 3
0
 def GetSubContentDetails(self, nodedata, *args):
     scrolllist = []
     corpinfo = sm.GetService('corp').GetCorporation()
     founderdone = 0
     if cfg.invtypes.Get(cfg.eveowners.Get(corpinfo.ceoID).typeID).groupID == const.groupCharacter:
         if corpinfo.creatorID == corpinfo.ceoID:
             ceoLabel = 'UI/Corporations/CorpUIHome/CeoAndFounder'
             founderdone = 1
         else:
             ceoLabel = 'UI/Corporations/Common/CEO'
         scrolllist.append(self.GetListEntry(ceoLabel, localization.GetByLabel('UI/Corporations/CorpUIHome/PlayerNamePlaceholder', player=corpinfo.ceoID), typeID=const.typeCharacterAmarr, itemID=corpinfo.ceoID))
     if not founderdone and cfg.invtypes.Get(cfg.eveowners.Get(corpinfo.creatorID).typeID).groupID == const.groupCharacter:
         scrolllist.append(self.GetListEntry('UI/Corporations/Common/Founder', localization.GetByLabel('UI/Corporations/CorpUIHome/PlayerNamePlaceholder', player=corpinfo.creatorID), typeID=const.typeCharacterAmarr, itemID=corpinfo.creatorID))
     if corpinfo.stationID:
         station = sm.GetService('map').GetStation(corpinfo.stationID)
         row = Row(['stationID', 'typeID'], [corpinfo.stationID, station.stationTypeID])
         jumps = sm.GetService('clientPathfinderService').GetJumpCountFromCurrent(station.solarSystemID)
         scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/Headquarters', localization.GetByLabel('UI/Corporations/CorpUIHome/StationAndJumps', station=station.stationID, jumpCount=jumps, jumps=jumps), typeID=station.stationTypeID, itemID=corpinfo.stationID, station=row))
     scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/TickerName', localization.GetByLabel('UI/Corporations/CorpUIHome/TickerNamePlaceholder', ticker=corpinfo.tickerName)))
     scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/Shares', localization.formatters.FormatNumeric(value=corpinfo.shares)))
     if not util.IsNPC(eve.session.corpid):
         scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/MemberCount', localization.formatters.FormatNumeric(value=corpinfo.memberCount)))
     scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/TaxRate', localization.GetByLabel('UI/Corporations/CorpUIHome/TaxRatePlaceholder', tax=corpinfo.taxRate * 100)))
     if corpinfo.url:
         linkTag = '<url=%s>' % corpinfo.url
         scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/URL', localization.GetByLabel('UI/Corporations/CorpUIHome/URLPlaceholder', linkTag=linkTag, url=corpinfo.url)))
     enabledDisabledText = localization.GetByLabel('UI/Corporations/CorpUIHome/Enabled')
     if not corpinfo.isRecruiting:
         enabledDisabledText = localization.GetByLabel('UI/Corporations/CorpUIHome/Disabled')
     scrolllist.append(self.GetListEntry('UI/Corporations/CorpUIHome/MembershipApplication', enabledDisabledText))
     myListEntry = listentry.Get('FriendlyFireEntry', {'line': 1,
      'label': localization.GetByLabel('UI/Corporations/CorpUIHome/FriendlyFire'),
      'text': 'text'})
     scrolllist.append(myListEntry)
     return scrolllist
Exemplo n.º 4
0
    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 = 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
Exemplo n.º 5
0
    def _LoadTargetBalls(self):
        """
        Make sure for each target we have a client side ball, and remove any
        targets that have been removed.
        """
        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._CreateTargetBall(district, targetID)
                header = ['itemID',
                 'typeID',
                 'ownerID',
                 'groupID',
                 'categoryID',
                 'quantity',
                 'singleton',
                 'stacksize',
                 'locationID',
                 'flagID',
                 'charID',
                 'corpID',
                 'allianceID',
                 'securityStatus',
                 'jumps',
                 'orbitalState',
                 'planetID']
                targetItem = 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)

        for itemID, ball in self.balls.items():
            if itemID not in self.targets:
                sm.GetService('target').OnTargetLost(ball.id, None)
                sm.GetService('target').ArrangeTargets()
                uthread.new(self._DestroyTargetBall, itemID)
Exemplo n.º 6
0
 def UpdateUI(self):
     wnd = self.GetWnd()
     if not wnd or wnd.destroyed:
         return
     hd, li = blue.pyos.ProbeStuff()
     info = 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)
         ciderVersion = ''
         if blue.sysinfo.isTransgaming:
             ciderVersion = ' - Cider: %s' % blue.win32.TGGetVersion()
         fps = 'Fps: %.1f - %s%s' % (blue.os.fps, iml, ciderVersion)
         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>' % (
             util.FmtAmt(virtualMem), dc, util.FmtAmt(delta), tdc,
             util.FmtAmt(self.totalVMDelta))
         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 wnd.sr.queueText.text != mo:
             wnd.sr.queueText.text = mo
     except Exception as e:
         print 'e', e
         self.uitimer = None
         sys.exc_clear()
Exemplo n.º 7
0
    def GetCapacity(self,
                    flag=None,
                    capacityItemID=None,
                    skipDistanceCheck=False):
        capacity = 0.0
        used = 0.0
        if self.broker is not None:
            try:
                contents = self.broker.inventory2.SelectItems(self.itemid,
                                                              flag=self.flagID)
            except UserError:
                contents = []

            capacity = evetypes.GetCapacity(self.invItem.typeID)
            used = 0.0
            for item in contents:
                vol = GetItemVolume(item)
                if vol > 0:
                    used = used + vol

        return Row(['capacity', 'used'], [capacity, used])
Exemplo n.º 8
0
 def SetStationItemBits(self, bits):
     self.__stationItem = Row([
         'hangarGraphicID', 'ownerID', 'itemID', 'serviceMask',
         'stationTypeID'
     ], bits)
Exemplo n.º 9
0
    def GetMembersListData(self):
        corporation = self.corpSvc.GetCorporation()
        IAmCEO = corporation.ceoID == session.charid
        IAmDirector = session.corprole & const.corpRoleDirector and not IAmCEO
        member = self.member
        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
        memberIsCEO = member.characterID == corporation.ceoID
        memberIsDirector = roles & const.corpRoleDirector == const.corpRoleDirector
        if memberIsCEO or memberIsDirector:
            roles = 0
            for roleGrouping in self.roleGroupings.itervalues():
                appliesTo = roleGrouping.appliesTo
                appliesToGrantable = roleGrouping.appliesToGrantable
                if appliesTo == ROLES:
                    roles |= roleGrouping.roleMask
                elif appliesTo == ROLES_AT_HQ:
                    rolesAtHQ |= roleGrouping.roleMask
                elif appliesTo == ROLES_AT_BASE:
                    rolesAtBase |= roleGrouping.roleMask
                elif appliesTo == ROLES_AT_OTHER:
                    rolesAtOther |= roleGrouping.roleMask
                if appliesToGrantable == GRANTABLE_ROLES:
                    grantableRoles |= roleGrouping.roleMask
                elif appliesToGrantable == GRANTABLE_ROLES_AT_HQ:
                    grantableRolesAtHQ |= roleGrouping.roleMask
                elif appliesToGrantable == GRANTABLE_ROLES_AT_BASE:
                    grantableRolesAtBase |= roleGrouping.roleMask
                elif appliesToGrantable == GRANTABLE_ROLES_AT_OTHER:
                    grantableRolesAtOther |= roleGrouping.roleMask

            if memberIsDirector:
                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),
         memberIsCEO,
         memberIsDirector,
         IAmCEO,
         IAmDirector]
        return Row(self.GetRoleHeader(), line)
Exemplo n.º 10
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 = Row(self.sr.rowHeader, line)
        self.LogInfo(self.sr.node.rec)