Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions Scripts/Create-WorldMapFromWeb.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Filepath in the resources
[string]$OutFilePath = Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath "Source\NETworkManager\Resources\Maps\world-map.json"
[string]$CitiesOutFilePath = Join-Path -Path (Split-Path $PSScriptRoot -Parent) -ChildPath "Source\NETworkManager\Resources\Maps\world-cities.json"

# Resolution of the Natural Earth admin-0 countries / populated places dataset (110m, 50m or 10m - higher detail = larger file)
[string]$Resolution = "50m"

# A city is included if it's a national capital, or its population is at least this high
[int]$CityMinPopulation = 500000

# Download countries as plain GeoJSON (pre-converted from Natural Earth shapefiles, no TopoJSON decoding required)
$GeoJson = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/martynafford/natural-earth-geojson/master/$Resolution/cultural/ne_${Resolution}_admin_0_countries.json").Content | ConvertFrom-Json

# Rounds [lon, lat] pairs to 2 decimal places (~1.1 km), which is enough detail for an abstract, non-navigational map
function Get-RoundedRing {
param($Ring)

$Points = [System.Collections.Generic.List[object]]::new()

foreach ($Point in $Ring) {
$Points.Add(@([Math]::Round([double]$Point[0], 2), [Math]::Round([double]$Point[1], 2)))
}

# Unary comma prevents PowerShell from unrolling the list when there is only a single ring/point
, $Points
}

# Keeps only the outer ring of every polygon part (holes like inland lakes are not relevant for an abstract map)
function Get-OuterRings {
param($Geometry)

$Rings = [System.Collections.Generic.List[object]]::new()

switch ($Geometry.type) {
"Polygon" {
$Rings.Add((Get-RoundedRing -Ring $Geometry.coordinates[0]))
}
"MultiPolygon" {
foreach ($Part in $Geometry.coordinates) {
$Rings.Add((Get-RoundedRing -Ring $Part[0]))
}
}
}

, $Rings
}

$Countries = [System.Collections.Generic.List[object]]::new()

foreach ($Feature in $GeoJson.features) {
$Countries.Add([PSCustomObject]@{
n = $Feature.properties.ADMIN
r = Get-OuterRings -Geometry $Feature.geometry
})
}

ConvertTo-Json -InputObject $Countries -Depth 10 -Compress | Set-Content -Path $OutFilePath -Encoding utf8NoBOM

# Download populated places (cities) as plain GeoJSON
$PlacesGeoJson = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/martynafford/natural-earth-geojson/master/$Resolution/cultural/ne_${Resolution}_populated_places_simple.json").Content | ConvertFrom-Json

$Cities = [System.Collections.Generic.List[object]]::new()

foreach ($Feature in $PlacesGeoJson.features) {
$Properties = $Feature.properties

# Keep national capitals regardless of population, plus every other city above the threshold
if ($Properties.adm0cap -ne 1 -and $Properties.pop_max -lt $CityMinPopulation) {
continue
}

$Cities.Add([PSCustomObject]@{
n = $Properties.name
lat = [Math]::Round([double]$Properties.latitude, 2)
lon = [Math]::Round([double]$Properties.longitude, 2)
})
}

ConvertTo-Json -InputObject $Cities -Depth 5 -Compress | Set-Content -Path $CitiesOutFilePath -Encoding utf8NoBOM
4 changes: 2 additions & 2 deletions Source/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("2026.7.7.0")]
[assembly: AssemblyFileVersion("2026.7.7.0")]
[assembly: AssemblyVersion("2026.7.12.0")]
[assembly: AssemblyFileVersion("2026.7.12.0")]
22 changes: 14 additions & 8 deletions Source/NETworkManager.Documentation/ResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ public static class ResourceManager
/// <summary>
/// Static list with all resources that are used.
/// </summary>
public static List<ResourceInfo> List => new()
{
new ResourceInfo("Organizationally unique identifier", "https://standards-oui.ieee.org/oui/oui.txt",
public static List<ResourceInfo> List =>
[
new("Organizationally unique identifier", "https://standards-oui.ieee.org/oui/oui.txt",
Strings.Resource_OUI_Description),
new ResourceInfo("Service names and port numbers",

new("Service names and port numbers",
"https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml",
Strings.Resource_ServiceNamePortNumber_Description),
new ResourceInfo("flag-icon-css", "https://github.com/lipis/flag-icon-css",

new("flag-icon-css", "https://github.com/lipis/flag-icon-css",
Strings.Resource_Flag_Description),
new ResourceInfo("List of Top-Level-Domains", "https://data.iana.org/TLD/tlds-alpha-by-domain.txt",
Strings.Resource_ListTLD_Description)
};

new("List of Top-Level-Domains", "https://data.iana.org/TLD/tlds-alpha-by-domain.txt",
Strings.Resource_ListTLD_Description),

new("natural-earth-geojson", "https://github.com/martynafford/natural-earth-geojson",
Strings.Resource_NaturalEarth_Description)
];
}
66 changes: 60 additions & 6 deletions Source/NETworkManager.Localization/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Source/NETworkManager.Localization/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,15 @@
<data name="IPv6DefaultGateway" xml:space="preserve">
<value>IPv6-Default-Gateway</value>
</data>
<data name="Map" xml:space="preserve">
<value>Map</value>
</data>
<data name="PlusXMore" xml:space="preserve">
<value>(+{0} more)</value>
</data>
<data name="ScrollToZoomDragToPan" xml:space="preserve">
<value>Scroll = Zoom, Drag = Pan</value>
</data>
<data name="Maximum" xml:space="preserve">
<value>Maximum</value>
</data>
Expand Down Expand Up @@ -2985,6 +2994,9 @@ Error message:
<data name="Resource_ListTLD_Description" xml:space="preserve">
<value>List of Top-Level-Domains from iana.org, which is used to query whois servers of the TLD from whois.iana.org via port 43</value>
</data>
<data name="Resource_NaturalEarth_Description" xml:space="preserve">
<value>GeoJSON conversion of Natural Earth vector map data (CC0-1.0).</value>
</data>
<data name="Resource_OUI_Description" xml:space="preserve">
<value>OUI data from ieee.org.</value>
</data>
Expand Down Expand Up @@ -3683,6 +3695,9 @@ Changes to this value will take effect after the application is restarted. Wheth
<data name="CheckIPGeolocation" xml:space="preserve">
<value>Check IP geolocation</value>
</data>
<data name="ShowMap" xml:space="preserve">
<value>Show map</value>
</data>
<data name="HelpMessage_CheckDNSResolver" xml:space="preserve">
<value>The DNS resolver is determined via ip-api.com.

Expand Down Expand Up @@ -3823,6 +3838,9 @@ Try again in a few seconds.</value>
<data name="ExpandHostView" xml:space="preserve">
<value>Expand host view</value>
</data>
<data name="ExpandMapView" xml:space="preserve">
<value>Expand map view</value>
</data>
<data name="CannotSetHostWhileRunningMessage" xml:space="preserve">
<value>Host cannot be set while other hosts are being added. Please wait until the process is complete and try again.</value>
</data>
Expand Down
8 changes: 7 additions & 1 deletion Source/NETworkManager.Settings/GlobalStaticConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ public static class GlobalStaticConfiguration
// status changes collapses into a single sound instead of an overlapping cacophony.
public static int NotificationSoundThrottle => 3000;

// Tolerance for comparing two doubles (e.g. a resized panel width/height against a
// known constant) that are expected to be "close enough" rather than bit-for-bit equal.
public static double FloatPointFix => 1.0;

// Profile config
public static bool Profile_TagsMatchAny => true;
public static bool Profile_ExpandProfileView => true;
public static double Profile_WidthCollapsed => 40;
public static double Profile_DefaultWidthExpanded => 250;
public static double Profile_MaxWidthExpanded => 500;
public static double Profile_FloatPointFix => 1.0;
public static int Profile_EncryptionKeySize => 256;
public static int Profile_EncryptionIterations => 1000000;

Expand Down Expand Up @@ -166,6 +169,9 @@ public static class GlobalStaticConfiguration
public static int Traceroute_Buffer => 32;
public static bool Traceroute_ResolveHostname => true;
public static bool Traceroute_CheckIPApiIPGeolocation => false;
public static bool Traceroute_ShowMap => true;
public static bool Traceroute_ExpandMapView => true;
public static double Traceroute_MapHeight => 300;
public static ExportFileType Traceroute_ExportFileType => ExportFileType.Csv;

// Application: DNS Lookup
Expand Down
Loading
Loading