Fix mod name parse and add net9
This commit is contained in:
parent
d3c5584990
commit
160a085157
@ -19,13 +19,6 @@ public static class Extensions
|
|||||||
(list[i1], list[i2]) = (list[i2], list[i1]);
|
(list[i1], list[i2]) = (list[i2], list[i1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Span<byte> TrimEnd(this Span<byte> span, byte val = 0)
|
|
||||||
{
|
|
||||||
var i = span.Length - 1;
|
|
||||||
while (i > 0 && span[i--] == val) ;
|
|
||||||
return span[..i];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ExBinaryReader NextAsciiStringMustEqual(this ExBinaryReader binReader, ReadOnlySpan<byte> text)
|
public static ExBinaryReader NextAsciiStringMustEqual(this ExBinaryReader binReader, ReadOnlySpan<byte> text)
|
||||||
{
|
{
|
||||||
if (!binReader.IsNextAsciiStringEquals(text))
|
if (!binReader.IsNextAsciiStringEquals(text))
|
||||||
|
|||||||
@ -4,13 +4,13 @@
|
|||||||
<PackageId>SoulstormReplayReader.Core</PackageId>
|
<PackageId>SoulstormReplayReader.Core</PackageId>
|
||||||
<Authors>Bununic</Authors>
|
<Authors>Bununic</Authors>
|
||||||
<Company>Dowonline</Company>
|
<Company>Dowonline</Company>
|
||||||
<Version>1.0.5</Version>
|
<Version>1.0.6.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
|
||||||
<LangVersion>12.0</LangVersion>
|
<LangVersion>12</LangVersion>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Platforms>AnyCPU</Platforms>
|
<Platforms>AnyCPU</Platforms>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public sealed class SsReplayReader(Stream stream) : IDisposable
|
|||||||
Replay.Version = (ReplayVersion)_binaryReader.ReadInt32();
|
Replay.Version = (ReplayVersion)_binaryReader.ReadInt32();
|
||||||
|
|
||||||
var modNameSpan = _binaryReader.ReadBytes(stackalloc byte[32]);
|
var modNameSpan = _binaryReader.ReadBytes(stackalloc byte[32]);
|
||||||
Replay.ModName = Encoding.ASCII.GetString(modNameSpan.TrimEnd());
|
Replay.ModName = Encoding.ASCII.GetString(modNameSpan.TrimEnd<byte>(0));
|
||||||
|
|
||||||
_binaryReader // relic chunky
|
_binaryReader // relic chunky
|
||||||
.Skip(44)
|
.Skip(44)
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="TestReplays/*" CopyToOutputDirectory="PreserveNewest"/>
|
<None Include="TestReplays/**" CopyToOutputDirectory="PreserveNewest"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user