Skip to content

Commit

Permalink
Merge pull request #44 from Kevin0M16/v2.2
Browse files Browse the repository at this point in the history
v2.2
  • Loading branch information
Kevin0M16 authored Nov 5, 2022
2 parents e7d0c9c + 380217f commit 5d47798
Show file tree
Hide file tree
Showing 17 changed files with 1,045 additions and 2,409 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# CHANGELOG

## v2.2 (NOV 4 2022)
- Update for NMS 4.0 compatibility and save names, difficulty
- Added new features for locations management. Merge, delete, open, etc.
- Built NMSSaveManager to handle compression plus obfuscate and deobfuscate save file content using libNOM.map class library

## v2.1 (JULY 23 2022)
- Reworked location json, new naming, added longhex
- More calculations, more efficient lookups
- Few other validations
- Reworked Coordinate Calculator

## v2.0 (JULY 21 2022)
- Major Rework
- Fixed Issue #39 - Save file compression issue
- Updates and internal fixes and organization
- New Colors
- Tested on Endurance

## v1.1.16 (AUG 15 2020)
- Fixed missing space stations in list
- Added (EB) for ExternalBase to list of locations
Expand Down
19 changes: 9 additions & 10 deletions NMSCoordinates/Coords/CoordCalculations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static string DistanceToCenter(double x, double y, double z)
{
return string.Format("{0:0}", (Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2) + Math.Pow(z, 2)) * 100) * 4) + " ly"; //"{0:0.##}"
}
public static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec)
private static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec)
{
//PlanetNumber--SolarSystemIndex--GalaxyNumber--VoxelY--VoxelZ--VoxelX
//4 bit--12 bit--8 bit--8 bit--12 bit--12 bit
Expand Down Expand Up @@ -118,7 +118,7 @@ public static void CalculateLongHex(string hx, out string GalacticCoord2, out in

Planet = pidec;
}
public static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec, TextBox tb)
private static void CalculateLongHex(string hx, out string GalacticCoord2, out int Planet, out int galdec, TextBox tb)
{
//PlanetNumber--SolarSystemIndex--GalaxyNumber--VoxelY--VoxelZ--VoxelX
//4 bit--12 bit--8 bit--8 bit--12 bit--12 bit
Expand Down Expand Up @@ -192,7 +192,7 @@ public static void CalculateLongHex(string hx, out string GalacticCoord2, out in

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

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

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

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

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

return PortalCode;
}
public static string PortalToVoxel(string portalcode, TextBox tb)
private static void PortalToVoxel(string portalcode, TextBox tb)
{
//0 04A FB 9F6 C9D
//Break apart Portal Code
Expand Down Expand Up @@ -597,8 +598,6 @@ public static string PortalToVoxel(string portalcode, TextBox tb)
//Globals.AppendLine(tb, "Voxel Coordinates: X:" + shiftX + " Y:" + shiftY + " Z:" + shiftZ + " SSI:" + ssidec);
Globals.AppendLine(tb, "*** Voxel Coordinates - Portal#:" + iPlanet + " SSI#:" + iSSI + " Y:" + iY + " Z:" + iZ + " X:" + iX + " ***");
//voxel = "Portal#:" + "0" + " SSI:" + "0" + " Gal#:" + iSSI + " Y:" + iY + " Z:" + iZ + " X:" + iX;

return GalacticCoord2;
}
public static string VoxelToGalacticCoord(int X, int Y, int Z, int SSI)
{
Expand Down Expand Up @@ -660,7 +659,7 @@ public static string VoxelToGalacticCoord(int X, int Y, int Z, int SSI, TextBox

return GalacticCoord;
}
public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out int iX, out int iY, out int iZ, out int iSSI)
private static void GalacticToVoxel(string X, string Y, string Z, string SSI, out int iX, out int iY, out int iZ, out int iSSI)
{
//Galactic Coordinate to Voxel Coordinates

Expand Down Expand Up @@ -688,7 +687,7 @@ public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out
iZ = vZ;
iSSI = icSSI;
}
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)
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)
{
//Galactic Coordinate to Voxel Coordinates
tb.Clear();
Expand Down Expand Up @@ -717,7 +716,7 @@ public static void GalacticToVoxel(string X, string Y, string Z, string SSI, out
iZ = vZ;
iSSI = icSSI;
}
public static void GalacticToVoxel(string X, string Y, string Z, string SSI, TextBox tb)
private static void GalacticToVoxel(string X, string Y, string Z, string SSI, TextBox tb)
{
//Galactic Coordinate to Voxel Coordinates
tb.Clear();
Expand Down
6 changes: 0 additions & 6 deletions NMSCoordinates/Globals/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ public static string CheckGalaxyType(string igalaxy)
return "NORMAL";
}
}
public static string MakeUniqueSave(string path, int saveslot)
{
//Makes path in \backup\saves unique by date.time
path = String.Format("{0}{1}{2}{3}{4}", @".\backup\saves\", Path.GetFileNameWithoutExtension(path), "_" + saveslot + "_", DateTime.Now.ToString("yyyy-MM-dd-HHmmss"), Path.GetExtension(path));
return path;
}
public static string MakeUniqueLoc(string path, int saveslot)
{
//Makes path in \backup\saves unique by date.time
Expand Down
15 changes: 8 additions & 7 deletions NMSCoordinates/NMSCoordinates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,20 @@
<Reference Include="K4os.Compression.LZ4, Version=1.2.16.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.16\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="libNOM.map, Version=0.8.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\libNOM.map.0.8.3\lib\netstandard2.0\libNOM.map.dll</HintPath>
</Reference>
<Reference Include="Mnemosyne, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Mnemosyne.1.1.0.2\lib\netstandard2.0\Mnemosyne.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Octokit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octokit.1.0.0\lib\net46\Octokit.dll</HintPath>
<Reference Include="NMSSaveManager, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NMSSaveManager.1.0.2\lib\net472\NMSSaveManager.dll</HintPath>
</Reference>
<Reference Include="Octokit, Version=4.0.1.0, Culture=neutral, PublicKeyToken=0be8860aee462442, processorArchitecture=MSIL">
<HintPath>..\packages\Octokit.4.0.1\lib\netstandard2.0\Octokit.dll</HintPath>
</Reference>
<Reference Include="SpookilySharp, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SpookilySharp.1.2.0\lib\netstandard2.0\SpookilySharp.dll</HintPath>
Expand Down Expand Up @@ -126,7 +132,6 @@
<Compile Include="LocationData\LocationData.cs" />
<Compile Include="Coords\Coordinates.cs" />
<Compile Include="LocationData\LocationDataConverter.cs" />
<Compile Include="SaveCompression\SaveCompression.cs" />
<Compile Include="NMSCoordinatesMain.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -184,12 +189,8 @@
<Compile Include="UpdateChecker.Designer.cs">
<DependentUpon>UpdateChecker.cs</DependentUpon>
</Compile>
<Compile Include="SaveEncryption\GameSave.cs" />
<Compile Include="SaveEncryption\GameSaveManager.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SaveEncryption\Storage.cs" />
<Compile Include="SaveEncryption\XXTEA.cs" />
<EmbeddedResource Include="NMSCoordinatesMain.resx">
<DependentUpon>NMSCoordinatesMain.cs</DependentUpon>
<SubType>Designer</SubType>
Expand Down
Loading

0 comments on commit 5d47798

Please sign in to comment.