forked from aly/qstbak
muffin v7.5.12
This commit is contained in:
parent
3102923ce2
commit
911ed68baa
65 changed files with 2356 additions and 1539 deletions
Binary file not shown.
|
|
@ -18,11 +18,15 @@
|
|||
<None Remove="SmartNav.Data.chocobo-taxi-stands.bin" />
|
||||
<None Remove="SmartNav.Data.zone-sub-regions.bin" />
|
||||
<None Remove="SmartNav.Data.derived-arrivals.bin" />
|
||||
<None Remove="SmartNav.Data.npc-position-cache.bin" />
|
||||
<None Remove="SmartNav.Data.zone-boundary-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" />
|
||||
<EmbeddedResource Include="SmartNav.Data.zone-sub-regions.bin" LogicalName="SmartNav.Data.zone-sub-regions.bin" />
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="SmartNav.Model">
|
||||
|
|
|
|||
Binary file not shown.
BIN
SmartNav.Data/SmartNav.Data.npc-position-cache.bin
Normal file
BIN
SmartNav.Data/SmartNav.Data.npc-position-cache.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
SmartNav.Data/SmartNav.Data.zone-boundary-cache.bin
Normal file
BIN
SmartNav.Data/SmartNav.Data.zone-boundary-cache.bin
Normal file
Binary file not shown.
Binary file not shown.
16
SmartNav.Data/SmartNav.Data/AssemblyLgbCacheLoader.cs
Normal file
16
SmartNav.Data/SmartNav.Data/AssemblyLgbCacheLoader.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using System.IO;
|
||||
|
||||
namespace SmartNav.Data;
|
||||
|
||||
public static class AssemblyLgbCacheLoader
|
||||
{
|
||||
public static Stream OpenNpcPositionCache()
|
||||
{
|
||||
return SmartNavResources.OpenSealed("npc-position-cache.bin");
|
||||
}
|
||||
|
||||
public static Stream OpenZoneBoundaryCache()
|
||||
{
|
||||
return SmartNavResources.OpenSealed("zone-boundary-cache.bin");
|
||||
}
|
||||
}
|
||||
|
|
@ -4,18 +4,18 @@ internal static class DataBundleSecret
|
|||
{
|
||||
private static readonly byte[] A = new byte[32]
|
||||
{
|
||||
249, 130, 120, 19, 233, 226, 108, 14, 107, 82,
|
||||
130, 220, 135, 231, 132, 145, 238, 79, 114, 87,
|
||||
123, 65, 202, 110, 156, 178, 236, 146, 151, 20,
|
||||
187, 222
|
||||
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
|
||||
};
|
||||
|
||||
private static readonly byte[] B = new byte[32]
|
||||
{
|
||||
4, 22, 39, 195, 114, 48, 170, 103, 209, 88,
|
||||
134, 221, 112, 108, 144, 135, 150, 118, 49, 201,
|
||||
74, 13, 92, 179, 155, 25, 114, 34, 102, 151,
|
||||
79, 34
|
||||
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
|
||||
};
|
||||
|
||||
internal static byte[] Key()
|
||||
|
|
|
|||
|
|
@ -32,13 +32,32 @@ internal static class SmartNavResources
|
|||
|
||||
private static T? DeserializeResource<T>(string resourceName)
|
||||
{
|
||||
string name = Path.ChangeExtension(resourceName, ".bin");
|
||||
using Stream stream = Assembly.GetManifestResourceStream(name);
|
||||
if (stream == null)
|
||||
byte[] array = Unseal(Path.ChangeExtension(resourceName, ".bin"));
|
||||
if (array == null)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
using MemoryStream memoryStream = new MemoryStream();
|
||||
ReadOnlySpan<byte> readOnlySpan = array;
|
||||
if (readOnlySpan.StartsWith("\ufeff"u8))
|
||||
{
|
||||
readOnlySpan = readOnlySpan.Slice(3);
|
||||
}
|
||||
return JsonSerializer.Deserialize<T>(readOnlySpan);
|
||||
}
|
||||
|
||||
public static Stream OpenSealed(string fileName)
|
||||
{
|
||||
return new MemoryStream(Unseal("SmartNav.Data." + fileName) ?? throw new InvalidOperationException("embedded resource '" + fileName + "' is missing"), writable: false);
|
||||
}
|
||||
|
||||
private static byte[]? Unseal(string sealedName)
|
||||
{
|
||||
using Stream stream = Assembly.GetManifestResourceStream(sealedName);
|
||||
if (stream == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
using MemoryStream memoryStream = new MemoryStream((int)stream.Length);
|
||||
stream.CopyTo(memoryStream);
|
||||
byte[] array = memoryStream.ToArray();
|
||||
byte[] array2 = new byte[array.Length - 28];
|
||||
|
|
@ -52,7 +71,9 @@ internal static class SmartNavResources
|
|||
{
|
||||
CryptographicOperations.ZeroMemory(array3);
|
||||
}
|
||||
using DeflateStream utf8Json = new DeflateStream(new MemoryStream(array2), CompressionMode.Decompress);
|
||||
return JsonSerializer.Deserialize<T>(utf8Json);
|
||||
using DeflateStream deflateStream = new DeflateStream(new MemoryStream(array2), CompressionMode.Decompress);
|
||||
using MemoryStream memoryStream2 = new MemoryStream(array2.Length * 4);
|
||||
deflateStream.CopyTo(memoryStream2);
|
||||
return memoryStream2.ToArray();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue