Exemplo n.º 1
0
def installCharacterMonitor():
    global serviceInstance

    import blue
    from shootblues.common.eve import getCharacterName
    from shootblues.common import remoteCall
    from shootblues.common.service import forceStart

    class CharacterMonitorSvc:
        __notifyevents__ = ["OnSessionChanged"]

        def __init__(self):
            self.loggedInCharacter = None

        def OnSessionChanged(self, isRemote, session, change):
            if self.loggedInCharacter != session.charid:
                self.loggedInCharacter = session.charid
                characterName = getCharacterName(session.charid)
                remoteCall("common.script.dll", "LoggedInCharacterChanged",
                           characterName)

    serviceInstance = forceStart("charmonitor", CharacterMonitorSvc)
    serviceInstance.OnSessionChanged(False, eve.session, None)
def installCharacterMonitor():
    global serviceInstance
    
    import blue
    from shootblues.common.eve import getCharacterName
    from shootblues.common import remoteCall
    from shootblues.common.service import forceStart

    class CharacterMonitorSvc:
        __notifyevents__ = [
            "OnSessionChanged"
        ]

        def __init__(self):
            self.loggedInCharacter = None

        def OnSessionChanged(self, isRemote, session, change):
            if self.loggedInCharacter != session.charid:
                self.loggedInCharacter = session.charid
                characterName = getCharacterName(session.charid)
                remoteCall("common.script.dll", "LoggedInCharacterChanged", characterName)
    
    serviceInstance = forceStart("charmonitor", CharacterMonitorSvc)
    serviceInstance.OnSessionChanged(False, eve.session, None)
Exemplo n.º 3
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("targetcolors", TargetColorsSvc)
Exemplo n.º 4
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("broadcasthelper", BroadcastHelperSvc)
Exemplo n.º 5
0
def __load__():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("modulehelper", ModuleHelperSvc)
def __load__():
    global serviceInstance
    serviceInstance = forceStart("towermail", TowermailSvc)
Exemplo n.º 7
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("autotargeter", AutoTargeterSvc)
Exemplo n.º 8
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("activetanker", ActiveTankerSvc)
Exemplo n.º 9
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("activetanker", ActiveTankerSvc)
Exemplo n.º 10
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("weaponhelper", WeaponHelperSvc)
def __load__():
    forceStart("sessiontimer", SessionTimerSvc)
Exemplo n.º 12
0
def __load__():
    forceStart("sessiontimer", SessionTimerSvc)
Exemplo n.º 13
0
def __load__():
    global serviceInstance
    serviceInstance = forceStart("towermail", TowermailSvc)
Exemplo n.º 14
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("weaponhelper", WeaponHelperSvc)
def Automate(self, *args):
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("autoscan", AutoScanSvc)
    log("Starting up Autoscanner")
Exemplo n.º 16
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("dronehelper", DroneHelperSvc)
def __load__():
    global serviceInstance
    serviceInstance = forceStart("notificationlistener", NotificationListenerSvc)
Exemplo n.º 18
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("dronehelper", DroneHelperSvc)
Exemplo n.º 19
0
def initialize():
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("autotargeter", AutoTargeterSvc)
Exemplo n.º 20
0
def Automate(self, *args):
    global serviceRunning, serviceInstance
    serviceRunning = True
    serviceInstance = forceStart("autoscan", AutoScanSvc)
    log("Starting up Autoscanner")
Exemplo n.º 21
0
def installStateMonitor():
    global serviceInstance
    
    import blue
    import uthread
    from shootblues.common import remoteCall, log
    from shootblues.common.eve import getCharacterName, runOnMainThread
    from shootblues.common.service import forceStart

    class StateMonitorSvc:
        __notifyevents__ = [
            "DoBallsAdded",
            "DoBallRemove",
            "DoBallClear",
            "OnStandingSet",
            "OnStandingsModified",
            "OnSessionChanged"
        ]

        def __init__(self):
            self.forceFields = []
            self.objectCache = {}
            
            runOnMainThread(self.populateBalls)
        
        def dispose(self):
            for ci in self.objectCache.values():
                ci.removedFromBallpark()
                ci.clearFlag()
        
            self.forceFields = []
            self.objectCache = {}
        
        def flushCacheFor(self, id):
            if self.objectCache.has_key(id):
                del self.objectCache[id]
            
        def flushCache(self):
            self.objectCache = {}
        
        def get(self, id, ball=None, slimItem=None):
            result = self.objectCache.get(id, None)
            if not result:
                result = self.objectCache[id] = ItemDataCache(
                    id=id, ball=ball, slimItem=slimItem
                )
            
            return result
        
        def OnStandingSet(self, fromID, toID, standing):
            ce = self.objectCache.get(toID, None)
            if ce:
                ce.clearFlag()
        
        def OnStandingsModified(self, modifications):
            for obj in self.objectCache.values():
                obj.clearFlag()
        
        def OnSessionChanged(self, isRemote, session, change):
            self.flushCache()
                
        def populateBalls(self):    
            ballpark = eve.LocalSvc("michelle").GetBallpark()
            if not ballpark:
                return
            
            lst = []
            for ballID, ball in ballpark.balls.iteritems():
                slimItem = ballpark.GetInvItem(ballID)
                if slimItem:
                   lst.append((ball, slimItem))
            
            self._DoBallsAdded(lst)
        
        def DoBallsAdded(self, lst, **kwargs):
            uthread.pool(
                "DoBallsAdded",
                self._DoBallsAdded,
                lst
            )
        
        def _DoBallsAdded(self, lst):
            ballpark = eve.LocalSvc("michelle").GetBallpark()
            if not ballpark:
                return
            
            for (ball, slimItem) in lst:
                if slimItem.groupID == const.groupForceField:
                    self.forceFields.append(slimItem.itemID)
        
        def DoBallRemove(self, ball, slimItem, *args, **kwargs):
            if slimItem and (slimItem.itemID in self.forceFields):
                self.forceFields.remove(slimItem.itemID)
            
            if slimItem:
                ce = self.objectCache.get(slimItem.itemID, None)
                if ce:
                    ce.removedFromBallpark()
        
        def DoBallClear(self, solItem, **kwargs):
            self.forceFields = []
            
            for ce in self.objectCache.values():
                ce.removedFromBallpark()
            
    serviceInstance = forceStart("statemonitor", StateMonitorSvc)