Example #1
0
        /// <summary>
        ///     Add an item to this container
        /// </summary>
        /// <param name="item"></param>
        /// <param name="quantity"></param>
        /// <returns></returns>
        public bool Add(DirectItem item, int quantity)
        {
            // You can't fit modules like this
            if (_shipModules)
            {
                return(false);
            }

            if (item.LocationId == -1 || quantity < 1)
            {
                return(false);
            }

            var keywords = new Dictionary <string, object>();

            keywords.Add("qty", quantity);
            if (_pyFlag.IsValid)
            {
                keywords.Add("flag", _pyFlag);
            }
            if (!_pyFlag.IsValid && GroupId == (int)DirectEve.Const.GroupAuditLogSecureContainer)
            {
                keywords.Add("flag", DirectEve.Const.FlagUnlocked);
            }
            return(DirectEve.ThreadedCallWithKeywords(_pyInventory.Attribute("Add"), keywords, item.ItemId, item.LocationId));
        }
Example #2
0
        /// <summary>
        ///     Add multiple items to this container
        /// </summary>
        /// <param name="items"></param>
        /// <returns></returns>
        public bool Add(IEnumerable <DirectItem> items)
        {
            // You can't fit modules like this
            if (_shipModules)
            {
                return(false);
            }

            if (items.Count() == 0)
            {
                return(true);
            }

            var keywords = new Dictionary <string, object>();

            if (_pyFlag.IsValid)
            {
                keywords.Add("flag", _pyFlag);
            }
            if (!_pyFlag.IsValid && GroupId == (int)DirectEve.Const.GroupAuditLogSecureContainer)
            {
                keywords.Add("flag", DirectEve.Const.FlagUnlocked);
            }
            return(DirectEve.ThreadedCallWithKeywords(_pyInventory.Attribute("MultiAdd"), keywords, items.Select(i => i.ItemId), items.First().LocationId));
        }
 internal DirectReprocessingQuoteRecoverable(DirectEve directEve, PyObject recoverable) : base(directEve)
 {
     TypeId = (int) recoverable.Item(0);
     YouReceive = (long) recoverable.Item(1);
     WeTake = (long) recoverable.Item(2);
     Unrecoverable = (long) recoverable.Item(3);
 }
Example #4
0
        public IEnumerable <DirectOrder> GetMyOrders(bool bid = false)
        {
            //if (!DirectEve.HasSupportInstances())
            //{
            //    DirectEve.Log("DirectEve: Error: This method requires a support instance.");
            //    return null;
            //}

            var mq = DirectEve.GetLocalSvc("marketQuote");
            var mu = DirectEve.GetLocalSvc("marketutils");

            if (!IsReady)
            {
                return(null);
            }
            //IEnumerable<DirectOrder> orders = mq.Call("GetMyOrders").ToList().Select(o => new DirectOrder(this, o));
            if (!bid)
            {
                return
                    (PyWindow.Attribute("sr").Attribute("market").Attribute("sr").Attribute("myorders").Attribute("sr").Attribute("sellScroll").Attribute("sr").Attribute("entries").ToList().Select(o => new DirectOrder(DirectEve, o.Attribute("order"))));
            }
            else
            {
                return
                    (PyWindow.Attribute("sr").Attribute("market").Attribute("sr").Attribute("myorders").Attribute("sr").Attribute("buyScroll").Attribute("sr").Attribute("entries").ToList().Select(o => new DirectOrder(DirectEve, o.Attribute("order"))));
            }
        }
Example #5
0
        public ValueDumpUI()
        {
            Logging.Log("ValueDumpUI","Starting ValueDump",Logging.orange);
            InitializeComponent();

            InvTypesById = new Dictionary<int, InvTypeMarket>();
            Logging.Log("Valuedump", "Load InvTypes.xml from [" + InvTypesXMLData + "]", Logging.white);
            try
            {
                XDocument invTypes = XDocument.Load(InvTypesXMLData);
                if (invTypes.Root != null)
                    foreach (XElement element in invTypes.Root.Elements("invtype"))
                        InvTypesById.Add((int)element.Attribute("id"), new InvTypeMarket(element));
            }
            catch (Exception ex)
            {
                Logging.Log("ValueDumpUI","Unable to load [" + InvTypesXMLData + "] exception was [" + ex.Message + "]",Logging.orange);
            }
            
            Items = new List<ItemCacheMarket>();
            ItemsToSell = new List<ItemCacheMarket>();
            ItemsToRefine = new List<ItemCacheMarket>();

            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;
            _directEve.OnFrame += OnFrame;
        }
Example #6
0
        public Questor()
        {
            _lastPulse = DateTime.MinValue;

            _random = new Random();

            _salvage = new Salvage();
            _defense = new Defense();
            _combat = new Combat();
            _traveler = new Traveler();
            _unloadLoot = new UnloadLoot();
            _agentInteraction = new AgentInteraction();
            _arm = new Arm();
            _missionController = new MissionController();
            _drones = new Drones();
            _panic = new Panic();
            _storyline = new Storyline();

            Settings.Instance.SettingsLoaded += SettingsLoaded;

            // State fixed on ExecuteMission
            State = QuestorState.Idle;

            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;

            _directEve.OnFrame += OnFrame;
        }
Example #7
0
        internal DirectFleetMember(DirectEve directEve, PyObject memberObject)
            : base(directEve)
        {
            CharacterId = (int) memberObject.Attribute("charID");
            SquadID = (long) memberObject.Attribute("squadID");
            WingID = (long) memberObject.Attribute("wingID");
            Skills = new List<int>
            {
                (int) memberObject.Attribute("skills").ToList()[0],
                (int) memberObject.Attribute("skills").ToList()[1],
                (int) memberObject.Attribute("skills").ToList()[2]
            };

            if ((int) memberObject.Attribute("job") == (int) directEve.Const.FleetJobCreator)
                Job = JobRole.Boss;
            else
                Job = JobRole.RegularMember;

            if ((int) memberObject.Attribute("role") == (int) directEve.Const.FleetRoleLeader)
                Role = FleetRole.FleetCommander;
            else if ((int) memberObject.Attribute("role") == (int) directEve.Const.FleetRoleWingCmdr)
                Role = FleetRole.WingCommander;
            else if ((int) memberObject.Attribute("role") == (int) directEve.Const.FleetRoleSquadCmdr)
                Role = FleetRole.SquadCommander;
            else if ((int) memberObject.Attribute("role") == (int) directEve.Const.FleetRoleMember)
                Role = FleetRole.Member;

            ShipTypeID = (int?) memberObject.Attribute("shipTypeID");
            SolarSystemID = (int) memberObject.Attribute("solarSystemID");
        }
Example #8
0
        internal DirectOrder(DirectEve directEve, PyObject pyOrder)
            : base(directEve)
        {
            PyOrder = pyOrder;
            OrderId = -1;
            Price = (double) pyOrder.Attribute("price");
            VolumeRemaining = (int) pyOrder.Attribute("volRemaining");
            TypeId = (int) pyOrder.Attribute("typeID");
            if ((int) pyOrder.Attribute("range") == (int) DirectEve.Const.RangeSolarSystem)
                Range = DirectOrderRange.SolarSystem;
            else if ((int) pyOrder.Attribute("range") == (int) DirectEve.Const.RangeConstellation)
                Range = DirectOrderRange.Constellation;
            else if ((int) pyOrder.Attribute("range") == (int) DirectEve.Const.RangeRegion)
                Range = DirectOrderRange.Region;
            else if ((int) pyOrder.Attribute("range") == (int) DirectEve.Const.RangeStation)
                Range = DirectOrderRange.Station;
            else
                RangeAbsolute = (int) pyOrder.Attribute("range");

            OrderId = (long) pyOrder.Attribute("orderID");
            VolumeEntered = (int) pyOrder.Attribute("volEntered");
            MinimumVolume = (int) pyOrder.Attribute("minVolume");
            IsBid = (bool) pyOrder.Attribute("bid");
            IssuedOn = (DateTime) pyOrder.Attribute("issued");
            Duration = (int) pyOrder.Attribute("duration");
            StationId = (int) pyOrder.Attribute("stationID");
            RegionId = (int) pyOrder.Attribute("regionID");
            SolarSystemId = (int) pyOrder.Attribute("solarSystemID");
            Jumps = (int) pyOrder.Attribute("jumps");
        }
Example #9
0
        public FrmMain()
        {
            InitializeComponent();

            DirectEve = new DirectEve();
            DirectEve.OnFrame += OnFrame;
        }
Example #10
0
        internal DirectItemAttributes(DirectEve directEve, PyObject itemId)
            : base(directEve)
        {
            _chargedAttributes = directEve.GetLocalSvc("godma").Attribute("stateManager").Attribute("chargedAttributesByItemAttribute").DictionaryItem(itemId).ToDictionary <string>();
            _attributes        = directEve.GetLocalSvc("godma").Attribute("stateManager").Attribute("attributesByItemAttribute").DictionaryItem(itemId).ToDictionary <string>();

            if (_attributes.Keys.Count > 0)
            {
                return;
            }

            // Apparently we did not find any attributes, try through dogmaLocation.dogmaItems
            var dogmaLocation = directEve.GetLocalSvc("clientDogmaIM").Attribute("dogmaLocation");
            var dogmaItem     = dogmaLocation.Attribute("dogmaItems").DictionaryItem(itemId);

            if (!dogmaItem.IsValid)
            {
                return;
            }

            // Get the attribute-names dictionary
            var attributeNames = dogmaLocation.Attribute("dogmaStaticMgr").Attribute("attributes");

            // Convert new-style to old-style attributes
            foreach (var item in dogmaItem.Attribute("attributes").ToDictionary <int>())
            {
                var attributeName = (string)attributeNames.DictionaryItem(item.Key).Attribute("attributeName");
                var cachedValue   = dogmaItem.Attribute("attributeCache").DictionaryItem(item.Key);
                _attributes.Add(attributeName, cachedValue.IsValid ? cachedValue : item.Value);
            }
        }
Example #11
0
        /// <summary>
        ///     Set the name of an item.  Be sure to call DirectEve.ScatterEvent("OnItemNameChange") shortly after calling this
        ///     function.  Do not call ScatterEvent from the same frame!!
        /// </summary>
        /// <remarks>See menuSvc.SetName</remarks>
        /// <param name="name">The new name for this item.</param>
        /// <returns>true if successful.  false if not.</returns>
        public bool SetName(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(false);
            }

            if (CategoryId != (int)DirectEve.Const.CategoryShip && name.Length > 20)
            {
                return(false);
            }

            if (CategoryId != (int)DirectEve.Const.CategoryStructure && name.Length > 32)
            {
                return(false);
            }

            if (name.Length > 100)
            {
                return(false);
            }

            if (ItemId == 0 || !PyItem.IsValid)
            {
                return(false);
            }

            var pyCall = DirectEve.GetLocalSvc("invCache").Call("GetInventoryMgr").Attribute("SetLabel");

            return(DirectEve.ThreadedCall(pyCall, ItemId, name.Replace('\n', ' ')));
        }
        internal DirectMarketActionWindow(DirectEve directEve, PyObject pyWindow) : base(directEve, pyWindow)
        {
            IsReady      = (bool)pyWindow.Attribute("ready");
            IsBuyAction  = Name == "marketbuyaction";
            IsSellAction = Name == "marketsellaction";

            Item        = new DirectItem(directEve);
            Item.PyItem = pyWindow.Attribute("sr").Attribute("sellItem");

            var order = pyWindow.Attribute("sr").Attribute("currentOrder");

            Price           = (double?)order.Attribute("price");
            RemainingVolume = (double?)order.Attribute("volRemaining");
            Range           = (int?)order.Attribute("range");
            OrderId         = (long?)order.Attribute("orderID");
            EnteredVolume   = (int?)order.Attribute("volEntered");
            MinimumVolume   = (int?)order.Attribute("minVolume");
            IsBid           = (bool?)order.Attribute("bid");
            Issued          = (DateTime?)order.Attribute("issued");
            Duration        = (int?)order.Attribute("duration");
            StationId       = (long?)order.Attribute("stationID");
            RegionId        = (long?)order.Attribute("regionID");
            SolarSystemId   = (long?)order.Attribute("solarSystemID");
            Jumps           = (int?)order.Attribute("jumps");
        }
        internal DirectSystemScanResult(DirectEve directEve, PyObject pyResult)
            : base(directEve)
        {
            PyResult = pyResult;
            Id = (string) pyResult.Attribute("id");
            ScanGroupName = (string) pyResult.Attribute("scanGroupName").ToUnicodeString();
            GroupName = (string) pyResult.Attribute("groupName").ToUnicodeString();
            TypeName = (string) pyResult.Attribute("typeName").ToUnicodeString();
            SignalStrength = (double) pyResult.Attribute("certainty");
            Deviation = (double) pyResult.Attribute("deviation");
            IsPointResult = (string) PyResult.Attribute("data").Attribute("__class__").Attribute("__name__") == "Vector3";
            IsSpereResult = (string) PyResult.Attribute("data").Attribute("__class__").Attribute("__name__") == "float";
            IsCircleResult = (!IsPointResult && !IsSpereResult);
            if (IsPointResult)
            {
                X = (double?) pyResult.Attribute("data").Attribute("x");
                Y = (double?) pyResult.Attribute("data").Attribute("y");
                Z = (double?) pyResult.Attribute("data").Attribute("z");
            }
            else if (IsCircleResult)
            {
                X = (double?) pyResult.Attribute("data").Attribute("point").Attribute("x");
                Y = (double?) pyResult.Attribute("data").Attribute("point").Attribute("y");
                Z = (double?) pyResult.Attribute("data").Attribute("point").Attribute("z");
            }

            // If SphereResult: X,Y,Z is probe location

            if (X.HasValue && Y.HasValue && Z.HasValue)
            {
                var myship = directEve.ActiveShip.Entity;
                Distance = Math.Sqrt((X.Value - myship.X)*(X.Value - myship.X) + (Y.Value - myship.Y)*(Y.Value - myship.Y) + (Z.Value - myship.Z)*(Z.Value - myship.Z));
            }
        }
Example #14
0
        internal static List <DirectBookmark> GetBookmarks(DirectEve directEve)
        {
            // List the bookmarks from cache
            var bookmarks = directEve.GetLocalSvc("bookmarkSvc").Attribute("bookmarkCache").ToDictionary <long>();

            return(bookmarks.Values.Select(pyBookmark => new DirectBookmark(directEve, pyBookmark)).ToList());
        }
Example #15
0
 internal DirectRegion(DirectEve directEve, dynamic pyo)
     : base(directEve)
 {
     Id        = (long)pyo.regionID;
     Name      = (string)DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
     FactionId = (long?)pyo.factionID;
 }
Example #16
0
        internal static List <DirectBookmarkFolder> GetFolders(DirectEve directEve)
        {
            // List the bookmark folders from cache
            var folders = directEve.GetLocalSvc("bookmarkSvc").Attribute("folders").ToDictionary <long>();

            return(folders.Values.Select(pyFolder => new DirectBookmarkFolder(directEve, pyFolder)).ToList());
        }
Example #17
0
        internal static List <DirectAgentMission> GetAgentMissions(DirectEve directEve)
        {
            var missions = new List <DirectAgentMission>();

            var pyMissions = directEve.GetLocalSvc("journal").Attribute("agentjournal").Item(0).ToList();

            foreach (var pyMission in pyMissions)
            {
                var mission = new DirectAgentMission(directEve);
                mission.State     = (int)pyMission.Item(0);
                mission.Important = (bool)pyMission.Item(1);
                mission.Type      = (string)pyMission.Item(2);

                if ((int)pyMission.Item(3) > 0)
                {
                    mission.Name = (string)directEve.PySharp.Import("localization").Call("GetByMessageID", (int)pyMission.Item(3));
                }
                else
                {
                    mission.Name = "none";
                    continue;
                }

                mission._pyAgentId = pyMission.Item(4);
                mission.AgentId    = (long)pyMission.Item(4);

                mission.ExpiresOn = (DateTime)pyMission.Item(5);
                mission.Bookmarks = pyMission.Item(6).ToList().Select(b => new DirectAgentMissionBookmark(directEve, b)).ToList();
                missions.Add(mission);
            }

            return(missions);
        }
        internal DirectFittingManagerWindow(DirectEve directEve, PyObject pyWindow)
            : base(directEve, pyWindow)
        {
            var charId = DirectEve.Session.CharacterId;

            IsReady = charId != null && DirectEve.GetLocalSvc("fittingSvc").Attribute("fittings").DictionaryItem(charId.Value).IsValid;
        }
Example #19
0
        internal DirectWindow(DirectEve directEve, PyObject pyWindow) : base(directEve)
        {
            PyWindow = pyWindow;

            Id         = (int?)pyWindow.Attribute("windowID");
            Type       = (string)pyWindow.Attribute("__guid__");
            Name       = (string)pyWindow.Attribute("name");
            IsKillable = (bool)pyWindow.Attribute("_killable");
            IsDialog   = (bool)pyWindow.Attribute("isDialog");
            IsModal    = (bool)pyWindow.Attribute("isModal");
            Caption    = (string)pyWindow.Call("GetCaption");

            var paragraphs = pyWindow.Attribute("edit").Attribute("sr").Attribute("paragraphs").ToList();
            var html       = paragraphs.Aggregate("", (current, paragraph) => current + (string)paragraph.Attribute("text"));

            if (String.IsNullOrEmpty(html))
            {
                html = (string)pyWindow.Attribute("edit").Attribute("sr").Attribute("currentTXT");
            }
            if (String.IsNullOrEmpty(html))
            {
                html = (string)pyWindow.Attribute("sr").Attribute("messageArea").Attribute("sr").Attribute("currentTXT");
            }

            Html = html;

            ViewMode = (string)pyWindow.Attribute("viewMode");
        }
Example #20
0
        private static void Main(string[] args)
        {
            Logging.Log("GoToBM","Started",Logging.white);
            if (args.Length == 0 || args[0].Length < 1)
            {
                Logging.Log("GoToBM"," You need to supply a bookmark name",Logging.white);
                Logging.Log("GoToBM"," Ended",Logging.white);
                return;
            }
            _BM = args[0];
            _BM = _BM.ToLower();

            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;
            _directEve.OnFrame += OnFrame;
            _traveler = new Traveler();
            _cleanup = new Cleanup();
            _defense = new Defense();

            while (!_done)
            {
                System.Threading.Thread.Sleep(50);
            }

            _directEve.Dispose();
            Logging.Log("GoToBM"," Exiting",Logging.white);
            return;
        }
        internal DirectMarketActionWindow(DirectEve directEve, PyObject pyWindow)
            : base(directEve, pyWindow)
        {
            IsReady = (bool) pyWindow.Attribute("ready");
            IsBuyAction = Name == "marketbuyaction";
            IsSellAction = Name == "marketsellaction";

            Item = new DirectItem(directEve);
            Item.PyItem = pyWindow.Attribute("sr").Attribute("sellItem");

            var order = pyWindow.Attribute("sr").Attribute("currentOrder");
            Price = (double?) order.Attribute("price");
            RemainingVolume = (double?) order.Attribute("volRemaining");
            Range = (int?) order.Attribute("range");
            OrderId = (long?) order.Attribute("orderID");
            EnteredVolume = (int?) order.Attribute("volEntered");
            MinimumVolume = (int?) order.Attribute("minVolume");
            IsBid = (bool?) order.Attribute("bid");
            Issued = (DateTime?) order.Attribute("issued");
            Duration = (int?) order.Attribute("duration");
            StationId = (long?) order.Attribute("stationID");
            RegionId = (long?) order.Attribute("regionID");
            SolarSystemId = (long?) order.Attribute("solarSystemID");
            Jumps = (int?) order.Attribute("jumps");
        }
Example #22
0
 internal DirectReprocessingQuoteRecoverable(DirectEve directEve, PyObject recoverable) : base(directEve)
 {
     TypeId        = (int)recoverable.Item(0);
     YouReceive    = (long)recoverable.Item(1);
     WeTake        = (long)recoverable.Item(2);
     Unrecoverable = (long)recoverable.Item(3);
 }
Example #23
0
        /// <summary>
        ///     Add a skill to the start of the queue
        /// </summary>
        /// <param name="skill"></param>
        /// <returns></returns>
        public bool TrainSkillNow(DirectInvType skill)
        {
            //if (!DirectEve.HasSupportInstances())
            //{
            //    DirectEve.Log("DirectEve: Error: This method requires a support instance.");
            //    return false;
            //}

            if (!AreMySkillsReady)
            {
                return(false);
            }

            // Assume level 1
            var currentLevel = 1;

            // Get the skill from 'MySkills'
            var mySkill = MySkills.FirstOrDefault(s => s.TypeId == skill.TypeId);

            if (mySkill != null)
            {
                currentLevel = mySkill.Level;
            }

            return(DirectEve.ThreadedLocalSvcCall("skillqueue", "TrainSkillNow", skill.TypeId, currentLevel));
        }
Example #24
0
        internal DirectSystemScanResult(DirectEve directEve, PyObject pyResult)
            : base(directEve)
        {
            PyResult       = pyResult;
            Id             = (string)pyResult.Attribute("id");
            ScanGroupName  = (string)pyResult.Attribute("scanGroupName").ToUnicodeString();
            GroupName      = (string)pyResult.Attribute("groupName").ToUnicodeString();
            TypeName       = (string)pyResult.Attribute("typeName").ToUnicodeString();
            SignalStrength = (double)pyResult.Attribute("certainty");
            Deviation      = (double)pyResult.Attribute("deviation");
            IsPointResult  = (string)PyResult.Attribute("data").Attribute("__class__").Attribute("__name__") == "Vector3";
            IsSpereResult  = (string)PyResult.Attribute("data").Attribute("__class__").Attribute("__name__") == "float";
            IsCircleResult = (!IsPointResult && !IsSpereResult);
            if (IsPointResult)
            {
                X = (double?)pyResult.Attribute("data").Attribute("x");
                Y = (double?)pyResult.Attribute("data").Attribute("y");
                Z = (double?)pyResult.Attribute("data").Attribute("z");
            }
            else if (IsCircleResult)
            {
                X = (double?)pyResult.Attribute("data").Attribute("point").Attribute("x");
                Y = (double?)pyResult.Attribute("data").Attribute("point").Attribute("y");
                Z = (double?)pyResult.Attribute("data").Attribute("point").Attribute("z");
            }

            // If SphereResult: X,Y,Z is probe location

            if (X.HasValue && Y.HasValue && Z.HasValue)
            {
                var myship = directEve.ActiveShip.Entity;
                Distance = Math.Sqrt((X.Value - myship.X) * (X.Value - myship.X) + (Y.Value - myship.Y) * (Y.Value - myship.Y) + (Z.Value - myship.Z) * (Z.Value - myship.Z));
            }
        }
Example #25
0
        internal static List<DirectAgentMission> GetAgentMissions(DirectEve directEve)
        {
            var missions = new List<DirectAgentMission>();

            var pyMissions = directEve.GetLocalSvc("journal").Attribute("agentjournal").Item(0).ToList();

            foreach (var pyMission in pyMissions)
            {
                var mission = new DirectAgentMission(directEve);
                mission.State = (int) pyMission.Item(0);
                mission.Important = (bool) pyMission.Item(1);
                mission.Type = (string) pyMission.Item(2);

                if ((int) pyMission.Item(3) > 0)
                    mission.Name = (string) directEve.PySharp.Import("localization").Call("GetByMessageID", (int) pyMission.Item(3));
                else
                {
                    mission.Name = "none";
                    continue;
                }

                mission._pyAgentId = pyMission.Item(4);
                mission.AgentId = (long) pyMission.Item(4);

                mission.ExpiresOn = (DateTime) pyMission.Item(5);
                mission.Bookmarks = pyMission.Item(6).ToList().Select(b => new DirectAgentMissionBookmark(directEve, b)).ToList();
                missions.Add(mission);
            }

            return missions;
        }
Example #26
0
 internal DirectRegion(DirectEve directEve, dynamic pyo)
     : base(directEve)
 {
     Id = (long) pyo.regionID;
     Name = (string) DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
     FactionId = (long?) pyo.factionID;
 }
Example #27
0
        /// <summary>
        ///     Make this your active target
        /// </summary>
        /// <returns></returns>
        public bool MakeActiveTarget()
        {
            if (!IsTarget)
            {
                return(false);
            }

            if (IsActiveTarget)
            {
                return(true);
            }

            // Even though we uthread the thing, expect it to be instant
            var currentActiveTarget = DirectEve.Entities.FirstOrDefault(t => t.IsActiveTarget);

            if (currentActiveTarget != null)
            {
                currentActiveTarget.IsActiveTarget = false;
            }

            // Switch active targets
            var activeTarget = PySharp.Import("state").Attribute("activeTarget");

            return(IsActiveTarget = DirectEve.ThreadedLocalSvcCall("state", "SetState", Id, activeTarget, 1));
        }
Example #28
0
 internal DirectBookmarkFolder(DirectEve directEve, PyObject pyFolder)
     : base(directEve)
 {
     Id        = (long)pyFolder.Attribute("folderID");
     Name      = (string)pyFolder.Attribute("folderName");
     OwnerId   = (long)pyFolder.Attribute("ownerID");
     CreatorId = (long?)pyFolder.Attribute("creatorID");
 }
Example #29
0
 internal DirectConstellation(DirectEve directEve, PyObject pyo)
     : base(directEve)
 {
     Id        = (long)pyo.Attribute("constellationID");
     Name      = (string)DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
     RegionId  = (long)pyo.Attribute("regionID");
     FactionId = (long?)pyo.Attribute("factionID");
 }
Example #30
0
 internal DirectConstellation(DirectEve directEve, PyObject pyo)
     : base(directEve)
 {
     Id = (long) pyo.Attribute("constellationID");
     Name = (string) DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
     RegionId = (long) pyo.Attribute("regionID");
     FactionId = (long?) pyo.Attribute("factionID");
 }
Example #31
0
 public bool WarpTo()
 {
     if (SignalStrength == 1)
     {
         return(DirectEve.ThreadedLocalSvcCall("menu", "WarpToScanResult", Id));
     }
     return(false);
 }
Example #32
0
 internal DirectBookmarkFolder(DirectEve directEve, PyObject pyFolder)
     : base(directEve)
 {
     Id = (long) pyFolder.Attribute("folderID");
     Name = (string) pyFolder.Attribute("folderName");
     OwnerId = (long) pyFolder.Attribute("ownerID");
     CreatorId = (long?) pyFolder.Attribute("creatorID");
 }
Example #33
0
        public bool CopyBookmarksToCorpFolder()
        {
            if ((!BookmarkId.HasValue) || (DirectEve.Session.CorporationId == null))
            {
                return(false);
            }

            return(DirectEve.ThreadedLocalSvcCall("bookmarkSvc", "MoveBookmarksToFolder", DirectEve.Session.CorporationId, DirectEve.Session.CorporationId, PyBookmark.Attribute("bookmarkID")));
        }
Example #34
0
        public bool RemoveOffer()
        {
            if (State != (int)PySharp.Import("__builtin__").Attribute("const").Attribute("agentMissionStateOffered"))
            {
                return(false);
            }

            return(DirectEve.ThreadedLocalSvcCall("agents", "RemoveOfferFromJournal", _pyAgentId));
        }
Example #35
0
 /// <summary>
 ///     Open up the quick-buy window to buy more of this item
 /// </summary>
 /// <returns></returns>
 public bool QuickBuy()
 {
     //if (!DirectEve.HasSupportInstances())
     //{
     //    DirectEve.Log("DirectEve: Error: This method requires a support instance.");
     //    return false;
     //}
     return(DirectEve.ThreadedLocalSvcCall("marketutils", "Buy", TypeId, PyItem));
 }
Example #36
0
 public ValueDumpUI()
 {
     Logging.Log("ValueDump","Starting ValueDump",Logging.Orange);
     InitializeComponent();
     _market = new Market();
     _directEve = new DirectEve();
     Cache.Instance.DirectEve = _directEve;
     _directEve.OnFrame += OnFrame;
 }
Example #37
0
        public virtual bool Close()
        {
            if (!IsKillable)
            {
                return(false);
            }

            return(DirectEve.ThreadedCall(PyWindow.Attribute("CloseByUser")));
        }
Example #38
0
        /// <summary>
        ///     Perform the actual reprocessing
        /// </summary>
        /// <returns></returns>
        public bool Reprocess()
        {
            if (NeedsQuote)
            {
                return(false);
            }

            return(DirectEve.ThreadedCall(PyWindow.Attribute("OnOK")));
        }
Example #39
0
        /// <summary>
        ///     Update quote information
        /// </summary>
        /// <returns></returns>
        public bool GetQuotes()
        {
            if (!NeedsQuote)
            {
                return(false);
            }

            return(DirectEve.ThreadedCall(PyWindow.Attribute("OnGetQoutes")));
        }
Example #40
0
 public bool RepairAll()
 {
     //if (!DirectEve.HasSupportInstances())
     //{
     //    DirectEve.Log("DirectEve: Error: This method requires a support instance.");
     //    return false;
     //}
     return(DirectEve.ThreadedCall(PyWindow.Attribute("RepairAll")));
 }
Example #41
0
 /// <summary>
 ///     Approach target
 /// </summary>
 /// <returns></returns>
 public bool Approach()
 {
     if (DateTime.Now.Subtract(lastApproach).TotalSeconds < 10)
     {
         return(false);
     }
     lastApproach = DateTime.Now;
     return(DirectEve.ThreadedLocalSvcCall("menu", "Approach", Id));
 }
Example #42
0
        public bool UpdateBookmark(string name, string comment)
        {
            if (!BookmarkId.HasValue)
            {
                return(false);
            }

            return(DirectEve.ThreadedLocalSvcCall("bookmarkSvc", "UpdateBookmark", PyBookmark.Attribute("bookmarkID"), PyBookmark.Attribute("ownerID"), name, comment, PyBookmark.Attribute("folderID")));
        }
Example #43
0
        public bool ReloadAmmo(DirectItem charge)
        {
            if (charge.ItemId <= 0)
            {
                return(false);
            }

            return(DirectEve.ThreadedCall(_pyModule.Attribute("ReloadAmmo"), charge.ItemId, 1, charge.IsSingleton));
        }
Example #44
0
 public bool Activate()
 {
     if (DateTime.Now.Subtract(lastActivation).TotalSeconds < 5)
     {
         return(false);
     }
     lastActivation = DateTime.Now;
     return(DirectEve.ThreadedCall(_pyModule.Attribute("ActivateEffect"), _pyModule.Attribute("def_effect")));
 }
Example #45
0
        public static Dictionary<int, DirectStation> GetStations(DirectEve directEve)
        {
            var result = new Dictionary<int, DirectStation>();

            var pyDict = directEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("stations").Attribute("data").ToDictionary<int>();
            foreach (var pair in pyDict)
                result[pair.Key] = new DirectStation(directEve, pair.Value);

            return result;
        }
Example #46
0
 internal DirectTradeWindow(DirectEve directEve, PyObject pyWindow)
     : base(directEve, pyWindow)
 {
     MyAccepted = (int) PyWindow.Attribute("sr").Attribute("myAccept").Attribute("state") == 1;
     HerAccepted = (int) PyWindow.Attribute("sr").Attribute("herAccept").Attribute("state") == 1;
     HerCharacterId = (int) PyWindow.Attribute("sr").Attribute("herinfo").Attribute("ownerID");
     HerName = (string) PyWindow.Attribute("sr").Attribute("herinfo").Attribute("ownerName").ToUnicodeString();
     MyOfferedIsk = (string) PyWindow.Attribute("sr").Attribute("myMoney").Attribute("text").ToUnicodeString();
     HerOfferedIsk = (string) PyWindow.Attribute("sr").Attribute("herMoney").Attribute("text").ToUnicodeString();
 }
Example #47
0
 internal DirectScannerWindow(DirectEve directEve, PyObject pyWindow)
     : base(directEve, pyWindow)
 {
     var charId = DirectEve.Session.CharacterId;
     var obj = PyWindow.Attribute("busy");
     var analyseBtnEnabled = (bool)pyWindow.Attribute("sr").Attribute("analyzeBtn").Attribute("enabled");
     //Log("obj type = " + obj.GetPyType().ToString());
     //Log("obj value = " + ((bool) obj).ToString());
     IsReady = charId != null && obj.IsValid && (bool)obj == false && analyseBtnEnabled;
 }
Example #48
0
 internal DirectSolarSystem(DirectEve directEve, PyObject pyo)
     : base(directEve)
 {
     Id = (int) pyo.Attribute("solarSystemID");
     Name = (string) DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
     ConstellationId = (long) pyo.Attribute("constellationID");
     FactionId = (long?) pyo.Attribute("factionID");
     Security = (double) pyo.Attribute("securityStatus");
     IsWormholeSystem = ((long) directEve.Const.MapWormholeSystemMin < Id && Id < (long) directEve.Const.MapWormholeSystemMax);
 }
Example #49
0
        public static Dictionary<long, DirectConstellation> GetConstellations(DirectEve directEve)
        {
            var result = new Dictionary<long, DirectConstellation>();

            var pyDict = directEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("mapConstellationCache").ToDictionary<long>();
            foreach (var pair in pyDict)
                result[pair.Key] = new DirectConstellation(directEve, pair.Value);

            return result;
        }
Example #50
0
        internal DirectContainer(DirectEve directEve, PyObject pyInventory, PyObject pyFlag)
            : base(directEve)
        {
            _pyInventory = pyInventory;
            _pyFlag = pyFlag;

            TypeId = (int) pyInventory.Attribute("typeID");

            if (!pyInventory.Attribute("listed").IsValid || pyInventory.Attribute("listed").IsNull || pyInventory.Attribute("listed").IsNone)
                DirectItem.RefreshItems(directEve, pyInventory, pyFlag);
        }
 //private DirectEve DirectEve;
 internal DirectContainerWindow(DirectEve directEve, PyObject pyWindow)
     : base(directEve, pyWindow)
 {
     //IsReady = (bool) pyWindow.Attribute("startedUp");
     IsOneWay = (bool) pyWindow.Attribute("oneWay");
     ItemId = (long) pyWindow.Attribute("itemID");
     LocationFlag = (int) pyWindow.Attribute("locationFlag");
     HasCapacity = (bool) pyWindow.Attribute("hasCapacity");
     currInvIdName = (string) PyWindow.Attribute("currInvID").ToList().First();
     currInvIdItem = (long) PyWindow.Attribute("currInvID").ToList().Last();
 }
Example #52
0
 internal DirectStation(DirectEve directEve, PyObject pyo)
     : base(directEve)
 {
     Id = (int) pyo.Attribute("stationID");
     Name = (string) pyo.Attribute("stationName");
     X = (double) pyo.Attribute("x");
     Y = (double) pyo.Attribute("y");
     Z = (double) pyo.Attribute("z");
     TypeId = (int) pyo.Attribute("stationTypeID");
     SolarSystemId = (int) pyo.Attribute("solarSystemID");
 }
Example #53
0
        public static Dictionary<long, DirectRegion> GetRegions(DirectEve directEve)
        {
            var result = new Dictionary<long, DirectRegion>();

            dynamic ps = directEve.PySharp;
            Dictionary<long, PyObject> pyDict = ps.__builtin__.cfg.mapRegionCache.ToDictionary<long>();
            foreach (var pair in pyDict)
                result[pair.Key] = new DirectRegion(directEve, pair.Value);

            return result;
        }
 internal DirectAgentMissionBookmark(DirectEve directEve, PyObject pyBookmark)
     : base(directEve, pyBookmark)
 {
     AgentId = (long?) pyBookmark.Attribute("agentID");
     IsDeadspace = (bool?) pyBookmark.Attribute("deadspace");
     Flag = (int?) pyBookmark.Attribute("flag");
     LocationNumber = (int?) pyBookmark.Attribute("locationNumber");
     LocationType = (string) pyBookmark.Attribute("locationType");
     Title = (string) pyBookmark.Attribute("hint");
     SolarSystemId = (long?) pyBookmark.Attribute("solarsystemID");
 }
        internal DirectReprocessingQuote(DirectEve directEve, long itemId, PyObject quote)
            : base(directEve)
        {
            ItemId = itemId;
            QuantityToProcess = (long) quote.Attribute("quantityToProcess");
            LeftOvers = (long) quote.Attribute("leftOvers");
            PlayerStanding = (float) quote.Attribute("olayerStanding");

            Recoverables = new List<DirectReprocessingQuoteRecoverable>();
            foreach (var recoverable in quote.Attribute("recoverables").Attribute("lines").ToList())
                Recoverables.Add(new DirectReprocessingQuoteRecoverable(DirectEve, recoverable));
        }
Example #56
0
        internal DirectEveSecurity(DirectEve directEve)
        {
            _directEve = directEve;
            #if DEBUG
            _directEve.Log("DirectEve: Debug: Starting security");
            #endif
            _version = Assembly.GetExecutingAssembly().GetName().Version;
            _pulseResult = true;
            _lastPulse = DateTime.Now;

            PerformStartupChecks();
        }
Example #57
0
        private static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Logging.Log("BuyLPI", "Syntax:", Logging.white);
                Logging.Log("BuyLPI", "DotNet BuyLPI BuyLPI <TypeName or TypeId> [Quantity]", Logging.white);
                Logging.Log("BuyLPI", "(Quantity is optional)", Logging.white);
                Logging.Log("BuyLPI", "", Logging.white);
                Logging.Log("BuyLPI", "Example:", Logging.white);
                Logging.Log("BuyLPI", "DotNet BuyLPI BuyLPI \"Caldari Navy Mjolnir Torpedo\" 10", Logging.white);
                Logging.Log("BuyLPI", "*OR*", Logging.white);
                Logging.Log("BuyLPI", "DotNet BuyLPI BuyLPI 27339 10", Logging.white);
                return;
            }

            if (args.Length >= 1)
            {
                _type = args[0];
            }

            if (args.Length >= 2)
            {
                int dummy;
                if (!int.TryParse(args[1], out dummy))
                {
                    Logging.Log("BuyLPI", "Quantity must be an integer, 0 - " + int.MaxValue, Logging.white);
                    return;
                }

                if (dummy < 0)
                {
                    Logging.Log("BuyLPI", "Quantity must be a positive number", Logging.white);
                    return;
                }

                _quantity = dummy;
                _totalquantityoforders = dummy;
            }

            Logging.Log("BuyLPI", "Starting BuyLPI...", Logging.white);
            _cleanup = new Cleanup();
            _directEve = new DirectEve();
            Cache.Instance.DirectEve = _directEve;
            _directEve.OnFrame += OnFrame;

            // Sleep until we're done
            while (_done.AddSeconds(5) > DateTime.Now)
                Thread.Sleep(50);

            _directEve.Dispose();
            Logging.Log("BuyLPI", "BuyLPI finished.", Logging.white);
        }
Example #58
0
        internal DirectEntity(DirectEve directEve, PyObject ballpark, PyObject ball, PyObject slimItem, long id)
            : base(directEve)
        {
            _ballpark = ballpark;
            _ball = ball;
            _slimItem = slimItem;

            Id = id;
            TypeId = (int) slimItem.Attribute("typeID");

            Attacks = new List<string>();
            ElectronicWarfare = new List<string>();
        }
Example #59
0
        private static void Main(string[] args)
        {
            Log("Starting GridMon...");
            _directEve = new DirectEve();
            _directEve.OnFrame += OnFrame;

            // Sleep until we're done
            while (!_done)
                Thread.Sleep(50);

            _directEve.Dispose();
            Log("GridMon finished.");
        }
Example #60
0
        private static void Main()
        {
            Log("Starting test...");
            _directEve = new DirectEve();
            _directEve.OnFrame += OnFrame;

            // Sleep until we're done
            while (!_done)
                Thread.Sleep(50);

            _directEve.Dispose();
            Log("Test finished.");
        }