Esempio n. 1
0
        internal static DirectAgent GetAgentById(DirectEve directEve, long id)
        {
            var pyAgent = directEve.GetLocalSvc("agents").Attribute("allAgentsByID").Attribute("items").DictionaryItem(id);

            var agent = new DirectAgent(directEve);

            agent.IsValid       = pyAgent.IsValid;
            agent.PyAgentId     = pyAgent.Item(0);
            agent.AgentId       = (long)pyAgent.Item(0);
            agent.AgentTypeId   = (long)pyAgent.Item(1);
            agent.DivisionId    = (long)pyAgent.Item(2);
            agent.Level         = (int)pyAgent.Item(3);
            agent.StationId     = (long)pyAgent.Item(4);
            agent.BloodlineId   = (long)pyAgent.Item(5);
            agent.Quality       = (int)pyAgent.Item(6);
            agent.CorpId        = (long)pyAgent.Item(7);
            agent.Gender        = (bool)pyAgent.Item(8);
            agent.FactionId     = (long)pyAgent.Item(10);
            agent.SolarSystemId = (long)pyAgent.Item(11);
            return(agent);
        }
Esempio n. 2
0
 /// <summary>
 ///   Invalidate the cached items
 /// </summary>
 public void InvalidateCache()
 {
     _windows = null;
     _unlootedContainers = null;
     _star = null;
     _stations = null;
     _stargates = null;
     _modules = null;
     _targets = null;
     _targeting = null;
     _targetedBy = null;
     _entities = null;
     _agent = null;
     _approaching = null;
     _activeDrones = null;
     _containers = null;
     _priorityTargets.ForEach(pt => pt.ClearCache());
     _entitiesById.Clear();
 }
Esempio n. 3
0
        internal static DirectAgent GetAgentById(DirectEve directEve, long id)
        {
            var pyAgent = directEve.GetLocalSvc("agents").Attribute("allAgentsByID").Attribute("items").DictionaryItem(id);

            var agent = new DirectAgent(directEve);
            agent.IsValid = pyAgent.IsValid;
            agent.PyAgentId = pyAgent.Item(0);
            agent.AgentId = (long) pyAgent.Item(0);
            agent.AgentTypeId = (long) pyAgent.Item(1);
            agent.DivisionId = (long) pyAgent.Item(2);
            agent.Level = (int) pyAgent.Item(3);
            agent.StationId = (long) pyAgent.Item(4);
            agent.BloodlineId = (long) pyAgent.Item(5);
            agent.Quality = (int) pyAgent.Item(6);
            agent.CorpId = (long) pyAgent.Item(7);
            agent.Gender = (bool) pyAgent.Item(8);
            agent.FactionId = (long) pyAgent.Item(10);
            agent.SolarSystemId = (long) pyAgent.Item(11);
            return agent;
        }
Esempio n. 4
0
        /// <summary>
        ///   Invalidate the cached items
        /// </summary>
        public void InvalidateCache()
        {
            try
            {
                //
                // this list of variables is cleared every pulse.
                //
                _activeDrones = null;
                _agent = null;
                _aggressed = null;
                _allBookmarks = null;
                _ammoHangar = null;
                _approaching = null;
                _activeDrones = null;
                _bestDroneTargets = null;
                _bestPrimaryWeaponTargets = null;
                _bigObjects = null;
                _bigObjectsAndGates = null;
                _combatTargets = null;
                _currentShipsCargo = null;
                _containerInSpace = null;
                _containers = null;
                _entities = null;
                _entitiesNotSelf = null;
                _entitiesOnGrid = null;
                _entitiesById.Clear();
                _fittingManagerWindow = null;
                _gates = null;
                _IDsinInventoryTree = null;
                _itemHangar = null;
                _jumpBridges = null;
                _lootContainer = null;
                _lootHangar = null;
                _lpStore = null;
                _maxLockedTargets = null;
                _maxDroneRange = null;
                _maxrange = null;
                _maxTargetRange = null;
                _modules = null;
                _modulesAsItemCache = null;
                _myShipEntity = null;
                _objects = null;
                _potentialCombatTargets = null;
                _primaryWeaponPriorityTargetsPerFrameCaching = null;
                _safeSpotBookmarks = null;
                _star = null;
                _stations = null;
                _stargate = null;
                _stargates = null;
                _targets = null;
                _targeting = null;
                _targetedBy = null;
                _TotalTargetsandTargeting = null;
                _unlootedContainers = null;
                _unlootedWrecksAndSecureCans = null;
                _weapons = null;
                _windows = null;

                _primaryWeaponPriorityEntities = null;
                _dronePriorityEntities = null;
                _preferredPrimaryWeaponTarget = null;

                //if (QuestorJustStarted && InvalidateCacheQuestorJustStartedFlag)
                //{
                //    InvalidateCacheQuestorJustStartedFlag = false;
                //     if (Settings.Instance.DebugPreferredPrimaryWeaponTarget) Logging.Log("Cache.InvalidateCache", "QuestorJustStarted: initializing", Logging.Debug);
                    if (_primaryWeaponPriorityTargets != null && _primaryWeaponPriorityTargets.Any())
                    {
                        _primaryWeaponPriorityTargets.ForEach(pt => pt.ClearCache());
                    }

                    if (_dronePriorityTargets != null && _dronePriorityTargets.Any())
                    {
                        _dronePriorityTargets.ForEach(pt => pt.ClearCache());
                    }
                //}
            }
            catch (Exception exception)
            {
                Logging.Log("Cache.InvalidateCache", "Exception [" + exception + "]", Logging.Debug);
            }
        }
Esempio n. 5
0
 /// <summary>
 ///   Invalidate the cached items
 /// </summary>
 public void InvalidateCache()
 {
     //
     // this list of variables is cleared every pulse.
     //
     _activeDrones = null;
     _agent = null;
     _aggressed = null;
     _approaching = null;
     _activeDrones = null;
     _bigObjects = null;
     _bigObjectsAndGates = null;
     _containers = null;
     _entities = null;
     _entitiesById.Clear();
     _gates = null;
     _IDsinInventoryTree = null;
     _modules = null;
     _objects = null;
     _priorityTargets.ForEach(pt => pt.ClearCache());
     _star = null;
     _stations = null;
     _stargates = null;
     _targets = null;
     _targeting = null;
     _targetedBy = null;
     _unlootedContainers = null;
     _windows = null;
 }
Esempio n. 6
0
 /// <summary>
 ///   Invalidate the cached items
 /// </summary>
 public void InvalidateCache()
 {
     try
     {
         //
         // this list of variables is cleared every pulse.
         //
         _activeDrones = null;
         _agent = null;
         _aggressed = null;
         _approaching = null;
         _activeDrones = null;
         _bigObjects = null;
         _bigObjectsAndGates = null;
         _containers = null;
         _entities = null;
         _entitiesById.Clear();
         _gates = null;
         _IDsinInventoryTree = null;
         _modules = null;
         _objects = null;
         _ongridKillableNPCs = null;
         _primaryWeaponPriorityTargets.ForEach(pt => pt.ClearCache());
         _dronePriorityTargets.ForEach(pt => pt.ClearCache());
         _safeSpotBookmarks = null;
         _star = null;
         _stations = null;
         _stargates = null;
         _targets = null;
         _targeting = null;
         _targetedBy = null;
         _unlootedContainers = null;
         _windows = null;
     }
     catch (Exception exception)
     {
         Logging.Log("Cache.InvalidateCache", "Exception [" + exception + "]", Logging.Debug);
     }
 }
Esempio n. 7
0
 /// <summary>
 ///     Return the agent by name
 /// </summary>
 /// <param name="agentName"></param>
 /// <returns></returns>
 public DirectAgent GetAgentByName(string agentName)
 {
     return(DirectAgent.GetAgentByName(this, agentName));
 }
Esempio n. 8
0
 /// <summary>
 ///     Return the agent by id
 /// </summary>
 /// <param name="agentId"></param>
 /// <returns></returns>
 public DirectAgent GetAgentById(long agentId)
 {
     return(DirectAgent.GetAgentById(this, agentId));
 }