muffin v7.5.13

This commit is contained in:
alydev 2026-08-22 10:25:22 +10:00
parent 911ed68baa
commit acf3e3cb18
69 changed files with 2731 additions and 1425 deletions

View file

@ -20,6 +20,7 @@
<None Remove="SmartNav.Data.derived-arrivals.bin" />
<None Remove="SmartNav.Data.npc-position-cache.bin" />
<None Remove="SmartNav.Data.zone-boundary-cache.bin" />
<None Remove="SmartNav.Data.water-cache.bin" />
<EmbeddedResource Include="SmartNav.Data.warp-destinations.bin" LogicalName="SmartNav.Data.warp-destinations.bin" />
<EmbeddedResource Include="SmartNav.Data.teleport-tickets.bin" LogicalName="SmartNav.Data.teleport-tickets.bin" />
<EmbeddedResource Include="SmartNav.Data.chocobo-taxi-stands.bin" LogicalName="SmartNav.Data.chocobo-taxi-stands.bin" />
@ -27,6 +28,7 @@
<EmbeddedResource Include="SmartNav.Data.derived-arrivals.bin" LogicalName="SmartNav.Data.derived-arrivals.bin" />
<EmbeddedResource Include="SmartNav.Data.npc-position-cache.bin" LogicalName="SmartNav.Data.npc-position-cache.bin" />
<EmbeddedResource Include="SmartNav.Data.zone-boundary-cache.bin" LogicalName="SmartNav.Data.zone-boundary-cache.bin" />
<EmbeddedResource Include="SmartNav.Data.water-cache.bin" LogicalName="SmartNav.Data.water-cache.bin" />
</ItemGroup>
<ItemGroup>
<Reference Include="SmartNav.Model">

Binary file not shown.

View file

@ -0,0 +1,29 @@
using System.Collections.Generic;
using System.IO;
using SmartNav.Model.Navigation;
namespace SmartNav.Data;
public static class AssemblyWaterMapLoader
{
public static (string? GameVersion, IReadOnlyDictionary<ushort, TerritoryWaterMap> Maps) GetWaterMaps(string? overrideDirectory = null)
{
using Stream stream = SmartNavResources.TryOpen("water-cache.bin", overrideDirectory);
if (stream == null)
{
return (GameVersion: null, Maps: new Dictionary<ushort, TerritoryWaterMap>());
}
(string GameVersion, List<TerritoryWaterMap> Maps) tuple = WaterCacheFormat.Read(stream);
string item = tuple.GameVersion;
List<TerritoryWaterMap> item2 = tuple.Maps;
Dictionary<ushort, TerritoryWaterMap> dictionary = new Dictionary<ushort, TerritoryWaterMap>(item2.Count);
foreach (TerritoryWaterMap item3 in item2)
{
if (!dictionary.TryAdd(item3.TerritoryId, item3))
{
throw new InvalidDataException($"water cache lists territory {item3.TerritoryId} twice");
}
}
return (GameVersion: item, Maps: dictionary);
}
}

View file

@ -4,18 +4,18 @@ internal static class DataBundleSecret
{
private static readonly byte[] A = new byte[32]
{
13, 38, 21, 255, 71, 40, 19, 213, 79, 201,
20, 24, 146, 227, 159, 156, 142, 23, 138, 144,
119, 132, 179, 149, 190, 134, 23, 209, 204, 192,
234, 63
71, 215, 20, 29, 12, 252, 253, 194, 59, 69,
18, 55, 34, 247, 239, 216, 228, 201, 157, 67,
207, 24, 144, 24, 62, 38, 55, 197, 249, 132,
62, 40
};
private static readonly byte[] B = new byte[32]
{
252, 191, 81, 239, 79, 239, 196, 247, 66, 179,
73, 171, 175, 76, 172, 241, 89, 23, 110, 4,
105, 193, 2, 137, 162, 77, 122, 136, 209, 181,
229, 197
63, 81, 210, 107, 86, 21, 96, 76, 152, 72,
178, 235, 191, 217, 62, 127, 34, 130, 14, 224,
171, 239, 111, 52, 2, 7, 1, 25, 82, 57,
94, 195
};
internal static byte[] Key()

View file

@ -45,6 +45,24 @@ internal static class SmartNavResources
return JsonSerializer.Deserialize<T>(readOnlySpan);
}
public static Stream? TryOpen(string fileName, string? overrideDirectory)
{
if (overrideDirectory != null)
{
string path = Path.Combine(overrideDirectory, fileName);
if (File.Exists(path))
{
return File.OpenRead(path);
}
}
byte[] array = Unseal("SmartNav.Data." + fileName);
if (array != null)
{
return new MemoryStream(array, writable: false);
}
return null;
}
public static Stream OpenSealed(string fileName)
{
return new MemoryStream(Unseal("SmartNav.Data." + fileName) ?? throw new InvalidOperationException("embedded resource '" + fileName + "' is missing"), writable: false);