Skip to content

Commit 5d47798

Browse files
authored
Merge pull request #44 from Kevin0M16/v2.2
v2.2
2 parents e7d0c9c + 380217f commit 5d47798

17 files changed

+1045
-2409
lines changed

CHANGELOG.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
# CHANGELOG
22

3+
## v2.2 (NOV 4 2022)
4+
- Update for NMS 4.0 compatibility and save names, difficulty
5+
- Added new features for locations management. Merge, delete, open, etc.
6+
- Built NMSSaveManager to handle compression plus obfuscate and deobfuscate save file content using libNOM.map class library
7+
38
## v2.1 (JULY 23 2022)
49
- Reworked location json, new naming, added longhex
510
- More calculations, more efficient lookups
611
- Few other validations
712
- Reworked Coordinate Calculator
8-
13+
914
## v2.0 (JULY 21 2022)
1015
- Major Rework
1116
- Fixed Issue #39 - Save file compression issue
1217
- Updates and internal fixes and organization
1318
- New Colors
1419
- Tested on Endurance
15-
20+
1621
## v1.1.16 (AUG 15 2020)
1722
- Fixed missing space stations in list
1823
- Added (EB) for ExternalBase to list of locations

NMSCoordinates/Coords/CoordCalculations.cs

+9-10
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static string DistanceToCenter(double x, double y, double z)
4444
{
4545
return string.Format("{0:0}", (Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2) + Math.Pow(z, 2)) * 100) * 4) + " ly"; //"{0:0.##}"
4646
}
47-
public static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec)
47+
private static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec)
4848
{
4949
//PlanetNumber--SolarSystemIndex--GalaxyNumber--VoxelY--VoxelZ--VoxelX
5050
//4 bit--12 bit--8 bit--8 bit--12 bit--12 bit
@@ -118,7 +118,7 @@ public static void CalculateLongHex(string hx, out string GalacticCoord2, out in
118118

119119
Planet = pidec;
120120
}
121-
public static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec, TextBox tb)
121+
private static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec, TextBox tb)
122122
{
123123
//PlanetNumber--SolarSystemIndex--GalaxyNumber--VoxelY--VoxelZ--VoxelX
124124
//4 bit--12 bit--8 bit--8 bit--12 bit--12 bit
@@ -192,7 +192,7 @@ public static void CalculateLongHex(string hx, out string GalacticCoord2, out in
192192

193193
Planet = pidec;
194194
}
195-
private void HexToVoxel(string basehx, out string GalacticCoord2, TextBox tb)
195+
private static void HexToVoxel(string basehx, TextBox tb)
196196
{
197197
//PlanetNumber--SolarSystemIndex--GalaxyNumber--VoxelY--VoxelZ--VoxelX
198198
//4 bit--12 bit--8 bit--8 bit--12 bit--12 bit
@@ -255,7 +255,7 @@ private void HexToVoxel(string basehx, out string GalacticCoord2, TextBox tb)
255255
//int ihexSSI = (Convert.ToInt32(ssidec, 16) & 0xFFFF); // SSI[HEX] to SSI[DEC] 3 digits
256256

257257
//Globals.AppendLine(textBox14, "P: " + "X:" + hexX + " Y:" + hexY + " Z:" + hexZ + " SSI:" + ssidec);
258-
GalacticCoord2 = string.Format("{0:X4}:{1:X4}:{2:X4}:{3:X4}", ihexX, ihexY, ihexZ, ssidec & 0xFFFF); //Format to 4 digit seperated by colon
258+
string GalacticCoord2 = string.Format("{0:X4}:{1:X4}:{2:X4}:{3:X4}", ihexX, ihexY, ihexZ, ssidec & 0xFFFF); //Format to 4 digit seperated by colon
259259
Globals.AppendLine(tb, "Galactic Coordinates: " + GalacticCoord2);
260260

261261
int shiftX = calc1 - 2047;
@@ -392,6 +392,7 @@ public static string GalacticToPortal(int Planet, string X, string Y, string Z,
392392

393393
string PortalCode = string.Format(Planet + "{0:X3}{1:X2}{2:X3}{3:X3}", ihexSSI, ihexY, ihexZ, ihexX); // Format digits 1 3 2 3 3
394394
//[P][SSI][Y][Z][X] Portal Code
395+
//Globals.AppendLine(tb, "*** Portal Code: " + PortalCode + " ***");
395396

396397
return PortalCode;
397398
//Globals.AppendLine(tb, "*** Portal Code: " + PortalCode + " ***");
@@ -545,7 +546,7 @@ public static string VoxelToPortal(int P, int X, int Y, int Z, int SSI, TextBox
545546

546547
return PortalCode;
547548
}
548-
public static string PortalToVoxel(string portalcode, TextBox tb)
549+
private static void PortalToVoxel(string portalcode, TextBox tb)
549550
{
550551
//0 04A FB 9F6 C9D
551552
//Break apart Portal Code
@@ -597,8 +598,6 @@ public static string PortalToVoxel(string portalcode, TextBox tb)
597598
//Globals.AppendLine(tb, "Voxel Coordinates: X:" + shiftX + " Y:" + shiftY + " Z:" + shiftZ + " SSI:" + ssidec);
598599
Globals.AppendLine(tb, "*** Voxel Coordinates - Portal#:" + iPlanet + " SSI#:" + iSSI + " Y:" + iY + " Z:" + iZ + " X:" + iX + " ***");
599600
//voxel = "Portal#:" + "0" + " SSI:" + "0" + " Gal#:" + iSSI + " Y:" + iY + " Z:" + iZ + " X:" + iX;
600-
601-
return GalacticCoord2;
602601
}
603602
public static string VoxelToGalacticCoord(int X, int Y, int Z, int SSI)
604603
{
@@ -660,7 +659,7 @@ public static string VoxelToGalacticCoord(int X, int Y, int Z, int SSI, TextBox
660659

661660
return GalacticCoord;
662661
}
663-
public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out int iX, out int iY, out int iZ, out int iSSI)
662+
private static void GalacticToVoxel(string X, string Y, string Z, string SSI, out int iX, out int iY, out int iZ, out int iSSI)
664663
{
665664
//Galactic Coordinate to Voxel Coordinates
666665

@@ -688,7 +687,7 @@ public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out
688687
iZ = vZ;
689688
iSSI = icSSI;
690689
}
691-
public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out int iX, out int iY, out int iZ, out int iSSI, TextBox tb)
690+
private static void GalacticToVoxel(string X, string Y, string Z, string SSI, out int iX, out int iY, out int iZ, out int iSSI, TextBox tb)
692691
{
693692
//Galactic Coordinate to Voxel Coordinates
694693
tb.Clear();
@@ -717,7 +716,7 @@ public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out
717716
iZ = vZ;
718717
iSSI = icSSI;
719718
}
720-
public static void GalacticToVoxel(string X, string Y, string Z, string SSI, TextBox tb)
719+
private static void GalacticToVoxel(string X, string Y, string Z, string SSI, TextBox tb)
721720
{
722721
//Galactic Coordinate to Voxel Coordinates
723722
tb.Clear();

NMSCoordinates/Globals/Globals.cs

-6
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,6 @@ public static string CheckGalaxyType(string igalaxy)
127127
return "NORMAL";
128128
}
129129
}
130-
public static string MakeUniqueSave(string path, int saveslot)
131-
{
132-
//Makes path in \backup\saves unique by date.time
133-
path = String.Format("{0}{1}{2}{3}{4}", @".\backup\saves\", Path.GetFileNameWithoutExtension(path), "_" + saveslot + "_", DateTime.Now.ToString("yyyy-MM-dd-HHmmss"), Path.GetExtension(path));
134-
return path;
135-
}
136130
public static string MakeUniqueLoc(string path, int saveslot)
137131
{
138132
//Makes path in \backup\saves unique by date.time

NMSCoordinates/NMSCoordinates.csproj

+8-7
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,20 @@
7979
<Reference Include="K4os.Compression.LZ4, Version=1.2.16.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
8080
<HintPath>..\packages\K4os.Compression.LZ4.1.2.16\lib\net46\K4os.Compression.LZ4.dll</HintPath>
8181
</Reference>
82+
<Reference Include="libNOM.map, Version=0.8.3.0, Culture=neutral, processorArchitecture=MSIL">
83+
<HintPath>..\packages\libNOM.map.0.8.3\lib\netstandard2.0\libNOM.map.dll</HintPath>
84+
</Reference>
8285
<Reference Include="Mnemosyne, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
8386
<HintPath>..\packages\Mnemosyne.1.1.0.2\lib\netstandard2.0\Mnemosyne.dll</HintPath>
8487
</Reference>
8588
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
8689
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
8790
</Reference>
88-
<Reference Include="Octokit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
89-
<HintPath>..\packages\Octokit.1.0.0\lib\net46\Octokit.dll</HintPath>
91+
<Reference Include="NMSSaveManager, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
92+
<HintPath>..\packages\NMSSaveManager.1.0.2\lib\net472\NMSSaveManager.dll</HintPath>
93+
</Reference>
94+
<Reference Include="Octokit, Version=4.0.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
95+
<HintPath>..\packages\Octokit.4.0.1\lib\netstandard2.0\Octokit.dll</HintPath>
9096
</Reference>
9197
<Reference Include="SpookilySharp, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
9298
<HintPath>..\packages\SpookilySharp.1.2.0\lib\netstandard2.0\SpookilySharp.dll</HintPath>
@@ -126,7 +132,6 @@
126132
<Compile Include="LocationData\LocationData.cs" />
127133
<Compile Include="Coords\Coordinates.cs" />
128134
<Compile Include="LocationData\LocationDataConverter.cs" />
129-
<Compile Include="SaveCompression\SaveCompression.cs" />
130135
<Compile Include="NMSCoordinatesMain.cs">
131136
<SubType>Form</SubType>
132137
</Compile>
@@ -184,12 +189,8 @@
184189
<Compile Include="UpdateChecker.Designer.cs">
185190
<DependentUpon>UpdateChecker.cs</DependentUpon>
186191
</Compile>
187-
<Compile Include="SaveEncryption\GameSave.cs" />
188-
<Compile Include="SaveEncryption\GameSaveManager.cs" />
189192
<Compile Include="Program.cs" />
190193
<Compile Include="Properties\AssemblyInfo.cs" />
191-
<Compile Include="SaveEncryption\Storage.cs" />
192-
<Compile Include="SaveEncryption\XXTEA.cs" />
193194
<EmbeddedResource Include="NMSCoordinatesMain.resx">
194195
<DependentUpon>NMSCoordinatesMain.cs</DependentUpon>
195196
<SubType>Designer</SubType>

0 commit comments

Comments
 (0)