コード例 #1
0
        private void LoadTravelHistorySignatures(EveJimaUniverse.System location)
        {
            listHistorySignatures.Items.Clear();
            listCosmicSifnatures.Items.Clear();

            //var fileName = @"Data/TravelHistory/" + location.SolarSystemName + ".csv";

            //try
            //{
            //    if (File.Exists(fileName) == false) return;

            //    using (var sr = new StreamReader(fileName))
            //    {
            //        var records = new CsvReader(sr).GetRecords<BasicCosmicSignature>();

            //        foreach (var record in records)
            //        {
            //            Log.DebugFormat("[whlTravelHistory.LoadTravelHistorySignatures] Read csv row. {0} {1}", record.Key, record.Value);
            //            listHistorySignatures.Items.Add(record.Key.Trim());
            //        }
            //    }
            //}
            //catch (Exception ex)
            //{
            //    Log.ErrorFormat("[whlTravelHistory.LoadTravelHistorySignatures] Critical error = {0}", ex);
            //}
        }
コード例 #2
0
        private EveJimaUniverse.System GetSolarSystemInformation(EveJimaUniverse.System system)
        {
            try
            {
                var systemInformation = Global.Space.GetSystemByName(system.Name);

                system.Id           = systemInformation.Id;
                system.Region       = systemInformation.Region;
                system.Class        = systemInformation.Class;
                system.Constelation = systemInformation.Constelation;
                system.Effect       = systemInformation.Effect;
                system.Moons        = systemInformation.Moons;
                system.Planets      = systemInformation.Planets;
                system.Security     = systemInformation.Security;
                system.Static       = systemInformation.Static;
                system.Static2      = systemInformation.Static2;
                system.Sun          = systemInformation.Sun;

                return(system);
            }
            catch (Exception)
            {
                return(system);
            }
        }
コード例 #3
0
ファイル: Map.cs プロジェクト: dunvit/EvaJimaPreRelease
        private void InsertNewPoint(string systemName)
        {
            var system = new EveJimaUniverse.System {
                Name = systemName, Created = DateTime.UtcNow
            };

            Systems.TryAdd(system.Name, system);
        }
コード例 #4
0
        private void RefreshSolarSystemInformation(EveJimaUniverse.System location)
        {
            if (InvokeRequired)
            {
                Invoke(new Action(() => RefreshSolarSystemInformation(location)));
            }

            if (Global.Pilots.Count() > 0)
            {
                _containerSolarSystem.RefreshSolarSystem(location);
                //_containerTravelHistory.RefreshSolarSystem(location);
            }
        }
コード例 #5
0
        public void RefreshSolarSystem(EveJimaUniverse.System location)
        {
            SolarSystem = location.Clone() as EveJimaUniverse.System;

            txtSolarSystemClass.Text = location.Class;
            if (location.Effect != null)
            {
                txtSolarSystemEffect.Text = location.Effect.Trim();
            }
            txtSolarSystemRegion.Text        = location.Region.Replace(" Unknown (", "").Replace(")", "");
            txtSolarSystemConstellation.Text = location.Constelation != null?location.Constelation.Replace(" Unknown (", "").Replace(")", "") : "";

            txtSolarSystemStaticI.Text  = "";
            txtSolarSystemStaticII.Text = "";

            txtSolarSystemStaticIData.Text  = "";
            txtSolarSystemStaticIIData.Text = "";

            txtSolarSystemStaticI.Visible      = false;
            txtSolarSystemStaticII.Visible     = false;
            txtSolarSystemStaticIData.Visible  = false;
            txtSolarSystemStaticIIData.Visible = false;

            if (string.IsNullOrEmpty(location.Static) == false)
            {
                var wormholeI = Global.Space.WormholeTypes[location.Static.Trim()];

                txtSolarSystemStaticI.Text        = wormholeI.Name;
                txtSolarSystemStaticI.Visible     = true;
                txtSolarSystemStaticI.ForeColor   = Tools.GetColorBySolarSystem(wormholeI.LeadsTo);
                txtSolarSystemStaticIData.Text    = wormholeI.LeadsTo;
                txtSolarSystemStaticIData.Visible = true;

                toolTip1.SetToolTip(txtSolarSystemStaticI, "Max Stable Mass=" + wormholeI.TotalMass + "\r\nMax Jump  Mass=" + wormholeI.SingleMass);
            }

            if (string.IsNullOrEmpty(location.Static2) == false)
            {
                var wormholeII = Global.Space.WormholeTypes[location.Static2.Trim()];


                txtSolarSystemStaticII.Text        = wormholeII.Name;
                txtSolarSystemStaticII.Visible     = true;
                txtSolarSystemStaticII.ForeColor   = Tools.GetColorBySolarSystem(wormholeII.LeadsTo);
                txtSolarSystemStaticIIData.Text    = wormholeII.LeadsTo;
                txtSolarSystemStaticIIData.Visible = true;

                toolTip2.SetToolTip(txtSolarSystemStaticII, "Max Stable Mass=" + wormholeII.TotalMass + "\r\nMax Jump  Mass=" + wormholeII.SingleMass);
            }
        }
コード例 #6
0
ファイル: Server.cs プロジェクト: dunvit/EvaJimaPreRelease
        private void MapsMergeAddSystem(Map map, Map localMap, EveJimaUniverse.System system)
        {
            foreach (var connection in system.ConnectedSolarSystems)
            {
                var connectedSystem = localMap.GetSystem(connection);

                if (mergedSystems.Contains(connection) == false)
                {
                    mergedSystems.Add(connection);

                    map.AddSolarSystem(system.Name, connectedSystem.Name, false);

                    MapsMergeAddSystem(map, localMap, connectedSystem);
                }
            }
        }
コード例 #7
0
        private void LoadLocationInfo(string solarSystemName)
        {
            Log.DebugFormat("[whlSolarSystemOffline.LoadLocationInfo] starting for solarSystemName = {0}", solarSystemName);

            try
            {
                if (SolarSystem == null)
                {
                    SolarSystem = new EveJimaUniverse.System();
                }

                if (Global.Space.GetSystemByName(solarSystemName) != null)
                {
                    var location = Global.Space.GetSystemByName(solarSystemName);

                    SolarSystem = location.Clone() as EveJimaUniverse.System;

                    if (SolarSystem != null)
                    {
                        SolarSystem.Id = Global.Space.GetSystemByName(solarSystemName.ToUpper()).Id;
                    }
                }
                else
                {
                    SolarSystem.Region       = "";
                    SolarSystem.Constelation = "";
                    SolarSystem.Effect       = "";
                    SolarSystem.Class        = "";
                    SolarSystem.Static2      = "";
                    SolarSystem.Static       = "";

                    SolarSystem.Id = Global.Space.GetSystemByName(solarSystemName.ToUpper()).Id;

                    SolarSystem.Name = solarSystemName;
                }
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("[whlSolarSystemOffline.LoadLocationInfo] Critical error. Exception {0}", ex);

                if (SolarSystem != null)
                {
                    SolarSystem.Name = "unknown";
                }
            }
        }
コード例 #8
0
ファイル: Map.cs プロジェクト: dunvit/EvaJimaPreRelease
        private Point GetLocationPoint(EveJimaUniverse.System fromSystem)
        {
            var deltaX = 0;
            var deltaY = 0;

            var isSearchingPositionInMap = true;

            while (isSearchingPositionInMap)
            {
                var point = GetPoint(fromSystem.LocationInMap.X, fromSystem.LocationInMap.Y);

                deltaX = point.X;
                deltaY = point.Y;

                isSearchingPositionInMap = isPositionUsedInMap(point.X, point.Y);
            }

            return(new Point(deltaX, deltaY));
        }
コード例 #9
0
        public void RefreshSolarSystem(EveJimaUniverse.System location)
        {
            if (location == null)
            {
                return;
            }

            try
            {
                txtSolarSystemName.Text = location.Name;

                txtSolarSystemRegion.Text = location.Region.Replace(" Unknown (", "").Replace(")", "");

                txtSolarSystemName.ForeColor = Tools.GetColorBySolarSystem(location.Security.ToString());
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("[mapSolarSystemKSpace.RefreshSolarSystem] Critical error. Exception {0}", ex);
            }
        }
コード例 #10
0
ファイル: MapTools.cs プロジェクト: dunvit/EvaJimaPreRelease
        public static SecurityStatus GetConnectionType(EveJimaUniverse.System solarSystemFrom, EveJimaUniverse.System solarSystemTo)
        {
            var _solarSystemFromInfo = Global.Space.GetSystemByName(solarSystemFrom.Name);
            var _solarSystemToInfo   = Global.Space.GetSystemByName(solarSystemTo.Name);

            if (_solarSystemFromInfo.Security == SecurityStatus.WSpace || _solarSystemToInfo.Security == SecurityStatus.WSpace)
            {
                return(SecurityStatus.WSpace);
            }

            if (_solarSystemFromInfo.Security == SecurityStatus.Nullsec || _solarSystemToInfo.Security == SecurityStatus.Nullsec)
            {
                return(SecurityStatus.Nullsec);
            }

            if (_solarSystemFromInfo.Security == SecurityStatus.Lowsec || _solarSystemToInfo.Security == SecurityStatus.Lowsec)
            {
                return(SecurityStatus.Lowsec);
            }

            return(SecurityStatus.Highsec);
        }
コード例 #11
0
 public void RefreshSolarSystem(EveJimaUniverse.System location)
 {
     LoadTravelHistorySignatures(location);
 }
コード例 #12
0
        private void LoadLocationInfo()
        {
            Log.DebugFormat("[Pilot.LoadLocationInfo] starting for Id = {0}", Id);

            _isBusy = true;

            var isNeedChangeLocation = false;

            try
            {
                if (Location == null)
                {
                    Location = new EveJimaUniverse.System();
                }

                Log.DebugFormat("[Pilot {0}] Call CrestData.GetLocation with ID={1}", Name, Id);

                dynamic locationInfo = EsiData.GetLocation(Id);

                var systemId = locationInfo.solar_system_id.ToString();

                dynamic solarSystemInfo = EsiData.GetSolarSystemInfo(systemId);

                var systemName = solarSystemInfo.name.ToString();

                if (Location.Name == systemName)
                {
                    Log.DebugFormat("[Pilot {0}] No need change location {1}", Name, Location.Name);
                    return;
                }

                if (!string.IsNullOrEmpty(systemId))
                {
                    if (LocationCurrentSystemName != systemName)
                    {
                        LocationPreviousSystemName = LocationCurrentSystemName;
                        LocationCurrentSystemName  = systemName;

                        isNeedChangeLocation = true;
                    }
                }

                if (Global.Space.GetSystemByName(systemName) != null)
                {
                    var location = Global.Space.GetSystemByName(systemName);

                    Location = location.Clone() as EveJimaUniverse.System;

                    if (Location != null)
                    {
                        Location.Id = systemId;
                    }
                }
                else
                {
                    Location.Region       = "";
                    Location.Constelation = "";
                    Location.Effect       = "";
                    Location.Class        = "";
                    Location.Static2      = "";
                    Location.Static       = "";

                    Location.Id = systemId;

                    Location.Name = systemName;
                }

                if (isNeedChangeLocation)
                {
                    ChangeLocation();
                }
            }
            catch (Exception ex)
            {
                Log.DebugFormat("[Pilot.LoadLocationInfo] pilot Id = {0} not login in game. Exception {1}", Id, ex);

                if (Location != null)
                {
                    Location.Name = "unknown";
                }
            }
            finally
            {
                _isBusy = false;
            }
        }
コード例 #13
0
        public void RefreshSolarSystem(EveJimaUniverse.System location)
        {
            if (location == null)
            {
                return;
            }

            try
            {
                Log.DebugFormat("[whlSolarSystem.RefreshSolarSystem] start");
                SolarSystem = location.Clone() as EveJimaUniverse.System;

                if (Global.Pilots.Selected.Location.Name == "unknown")
                {
                    return;
                }

                txtSolarSystemName.Text = Global.Pilots.Selected.Location.Name;

                txtSolarSystemStaticI.Text  = "";
                txtSolarSystemStaticII.Text = "";

                txtSolarSystemStaticIData.Text  = "";
                txtSolarSystemStaticIIData.Text = "";

                txtSolarSystemStaticI.Visible      = false;
                txtSolarSystemStaticII.Visible     = false;
                txtSolarSystemStaticIData.Visible  = false;
                txtSolarSystemStaticIIData.Visible = false;

                if (Tools.IsWSpaceSystem(Global.Pilots.Selected.Location.Name) == false)
                {
                    return;
                }

                txtSolarSystemClass.Text         = Global.Pilots.Selected.Location.Class;
                txtSolarSystemEffect.Text        = Global.Pilots.Selected.Location.Effect.Trim();
                txtSolarSystemRegion.Text        = Global.Pilots.Selected.Location.Region.Replace(" Unknown (", "").Replace(")", "");
                txtSolarSystemConstellation.Text = Global.Pilots.Selected.Location.Constelation.Replace(" Unknown (", "").Replace(")", "");

                var title = Global.Pilots.Selected.Location.Name + "";

                if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Class) == false)
                {
                    title = title + "[C" + Global.Pilots.Selected.Location.Class + "]";
                }

                if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Static) == false)
                {
                    var wormholeI = Global.Space.WormholeTypes[Global.Pilots.Selected.Location.Static.Trim()];

                    txtSolarSystemStaticI.Text        = wormholeI.Name;
                    txtSolarSystemStaticI.Visible     = true;
                    txtSolarSystemStaticI.ForeColor   = Tools.GetColorBySolarSystem(wormholeI.LeadsTo);
                    txtSolarSystemStaticIData.Text    = wormholeI.LeadsTo;
                    txtSolarSystemStaticIData.Visible = true;

                    toolTip1.SetToolTip(txtSolarSystemStaticI, "Max Stable Mass=" + wormholeI.TotalMass + "\r\nMax Jump  Mass=" + wormholeI.SingleMass + "\r\nMax Life time =" + wormholeI.Lifetime);

                    title = title + " " + wormholeI.Name + "[" + wormholeI.LeadsTo + "]";
                }

                if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Static2) == false)
                {
                    var wormholeII = Global.Space.WormholeTypes[Global.Pilots.Selected.Location.Static2.Trim()];


                    txtSolarSystemStaticII.Text        = wormholeII.Name;
                    txtSolarSystemStaticII.Visible     = true;
                    txtSolarSystemStaticII.ForeColor   = Tools.GetColorBySolarSystem(wormholeII.LeadsTo);
                    txtSolarSystemStaticIIData.Text    = wormholeII.LeadsTo;
                    txtSolarSystemStaticIIData.Visible = true;

                    toolTip2.SetToolTip(txtSolarSystemStaticII, "Max Stable Mass=" + wormholeII.TotalMass + "\r\nMax Jump  Mass=" + wormholeII.SingleMass + "\r\nMax Life time =" + wormholeII.Lifetime);

                    title = title + " " + wormholeII.Name + "[" + wormholeII.LeadsTo + "]";
                }

                if (OnChangeSolarSystemInfo == null)
                {
                    return;
                }

                try
                {
                    OnChangeSolarSystemInfo(title);
                }
                catch (Exception ex)
                {
                    Log.ErrorFormat("[whlSolarSystem.RefreshSolarSystem] Critical error = {0}", ex);
                }
            }
            catch (Exception)
            {
                //throw;
            }
        }
コード例 #14
0
        private void FillInformationForCurrentSolarSystems(EveJimaUniverse.System solarSystem)
        {
            if (solarSystem == null)
            {
                return;
            }

            if (InvokeRequired)
            {
                Invoke(new Action(() => FillInformationForCurrentSolarSystems(solarSystem)));
                return;
            }

            try
            {
                txtSolarSystemName.Text = solarSystem.Name;

                txtSolarSystemClass.Text = solarSystem.Class;

                if (solarSystem.Effect != null)
                {
                    txtSolarSystemEffect.Text = solarSystem.Effect.Trim() == "" ? "None" : solarSystem.Effect.Trim();
                }
                else
                {
                    txtSolarSystemEffect.Text = "";
                }

                if (solarSystem.Region != null)
                {
                    txtSolarSystemRegion.Text = solarSystem.Region.Replace(" Unknown (", "").Replace(")", "");
                }
                else
                {
                    txtSolarSystemRegion.Text = "";
                }


                txtSolarSystemStaticI.Text  = "";
                txtSolarSystemStaticII.Text = "";

                txtSolarSystemStaticI.Visible  = false;
                txtSolarSystemStaticII.Visible = false;

                label1.Visible = false;

                txtSolarSystemName.ForeColor = Tools.GetColorBySolarSystem(solarSystem.Security.ToString());

                if (string.IsNullOrEmpty(solarSystem.Static) == false)
                {
                    var wormholeI = Global.Space.WormholeTypes[solarSystem.Static.Trim()];

                    txtSolarSystemStaticI.Text      = wormholeI.Name + " " + wormholeI.LeadsTo;
                    txtSolarSystemStaticI.Visible   = true;
                    txtSolarSystemStaticI.ForeColor = Tools.GetColorBySolarSystem(wormholeI.LeadsTo);

                    //toolTip1.SetToolTip(txtSolarSystemStaticI, "Max Stable Mass=" + wormholeI.TotalMass + "\r\nMax Jump  Mass=" + wormholeI.SingleMass + "\r\nMax Life time =" + wormholeI.Lifetime);
                }

                if (string.IsNullOrEmpty(solarSystem.Static2) == false)
                {
                    label1.Visible = true;
                    var wormholeII = Global.Space.WormholeTypes[solarSystem.Static2.Trim()];

                    txtSolarSystemStaticII.Text      = wormholeII.Name + " " + wormholeII.LeadsTo;
                    txtSolarSystemStaticII.Visible   = true;
                    txtSolarSystemStaticII.ForeColor = Tools.GetColorBySolarSystem(wormholeII.LeadsTo);

                    //toolTip2.SetToolTip(txtSolarSystemStaticII, "Max Stable Mass=" + wormholeII.TotalMass + "\r\nMax Jump  Mass=" + wormholeII.SingleMass + "\r\nMax Life time =" + wormholeII.Lifetime);
                }
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("[SolarSystemInformationControl.FillInformationForCurrentSolarSystems] Critical error. Exception {0}", ex);
            }
        }
コード例 #15
0
        public void Initialize(string solarSystemName)
        {
            _solarSystem = Global.Space.GetSystemByName(solarSystemName);

            lblSolarSystemName.Text = _solarSystem.Name;
        }
コード例 #16
0
        public void RefreshSolarSystem(EveJimaUniverse.System location)
        {
            if (location == null)
            {
                return;
            }

            try
            {
                txtSolarSystemName.Text  = location.Name;
                txtSolarSystemClass.Text = location.Class;
                if (location.Effect != null)
                {
                    txtSolarSystemEffect.Text = location.Effect.Trim() == "" ? "None" : location.Effect.Trim();
                }
                else
                {
                    txtSolarSystemEffect.Text = "";
                }

                if (location.Region != null)
                {
                    txtSolarSystemRegion.Text = location.Region.Replace(" Unknown (", "").Replace(")", "");
                }
                else
                {
                    txtSolarSystemRegion.Text = "";
                }


                txtSolarSystemStaticI.Text  = "";
                txtSolarSystemStaticII.Text = "";

                txtSolarSystemStaticI.Visible  = false;
                txtSolarSystemStaticII.Visible = false;

                label1.Visible = false;

                txtSolarSystemName.ForeColor = Tools.GetColorBySolarSystem(location.Security.ToString());

                if (string.IsNullOrEmpty(location.Static) == false)
                {
                    var wormholeI = Global.Space.WormholeTypes[location.Static.Trim()];

                    txtSolarSystemStaticI.Text      = wormholeI.Name + " " + wormholeI.LeadsTo;
                    txtSolarSystemStaticI.Visible   = true;
                    txtSolarSystemStaticI.ForeColor = Tools.GetColorBySolarSystem(wormholeI.LeadsTo);

                    //toolTip1.SetToolTip(txtSolarSystemStaticI, "Max Stable Mass=" + wormholeI.TotalMass + "\r\nMax Jump  Mass=" + wormholeI.SingleMass + "\r\nMax Life time =" + wormholeI.Lifetime);
                }

                if (string.IsNullOrEmpty(location.Static2) == false)
                {
                    label1.Visible = true;
                    var wormholeII = Global.Space.WormholeTypes[location.Static2.Trim()];

                    txtSolarSystemStaticII.Text      = wormholeII.Name + " " + wormholeII.LeadsTo;
                    txtSolarSystemStaticII.Visible   = true;
                    txtSolarSystemStaticII.ForeColor = Tools.GetColorBySolarSystem(wormholeII.LeadsTo);

                    //toolTip2.SetToolTip(txtSolarSystemStaticII, "Max Stable Mass=" + wormholeII.TotalMass + "\r\nMax Jump  Mass=" + wormholeII.SingleMass + "\r\nMax Life time =" + wormholeII.Lifetime);
                }
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("[mapSolarSystemWSpace.RefreshSolarSystem] Critical error. Exception {0}", ex);
            }
        }