NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

skyhookSvc.py (1456B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\services\skyhookSvc.py
      2 from carbon.common.script.sys.service import Service
      3 from spacecomponents.common.components.linkWithShip import LINKSTATE_RUNNING
      4 
      5 class SkyhookSvc(Service):
      6     __guid__ = 'svc.skyhookSvc'
      7     __servicename__ = 'skyhookSvc'
      8     __displayname__ = 'Skyhook client service'
      9     __notifyevents__ = ['OnLinkedWithShipSiloItemUpdated']
     10 
     11     def Run(self, *args):
     12         super(SkyhookSvc, self).Run(*args)
     13         self._Initialize()
     14 
     15     def _Initialize(self):
     16         self.infoPanelSvc = sm.GetService('infoPanel')
     17         self.onGoingTheft = {}
     18 
     19     def OnLinkedWithShipSiloItemUpdated(self, itemID, solarsystemID, completeAtTime, state, duration):
     20         if state == LINKSTATE_RUNNING and solarsystemID == session.solarsystemid2:
     21             startTime = completeAtTime - duration
     22             self.onGoingTheft[itemID] = (startTime, completeAtTime)
     23             self.UpdatePanelContainer()
     24         else:
     25             self.onGoingTheft.pop(itemID, None)
     26             if state is None or solarsystemID != session.solarsystemid2:
     27                 self.UpdatePanelContainer()
     28 
     29     def UpdatePanelContainer(self):
     30         self.infoPanelSvc.UpdateSkyhookTheftPanel()
     31 
     32     def GetOnGoingTheft(self):
     33         return self.onGoingTheft
     34 
     35     def HasOnGoingTheft(self):
     36         if len(self.onGoingTheft) > 0:
     37             return True
     38         return False