Updated to net9.0

This commit is contained in:
Hondacrx
2025-06-08 18:24:11 -04:00
parent f5f5de1c86
commit d99305d96a
9 changed files with 17 additions and 11 deletions
+1
View File
@@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<StartupObject>BNetServer.Server</StartupObject>
<ApplicationIcon>Red.ico</ApplicationIcon>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Framework\Framework.csproj" />
@@ -262,10 +262,7 @@ namespace Framework.Cryptography.Ed25519
// Leading zero bytes get encoded as leading `1` characters
int leadingZeroCount = input.TakeWhile(c => c == '1').Count();
var leadingZeros = Enumerable.Repeat((byte)0, leadingZeroCount);
var bytesWithoutLeadingZeros =
intData.ToByteArray()
.Reverse()// to big endian
.SkipWhile(b => b == 0);//strip sign byte
var bytesWithoutLeadingZeros = intData.ToByteArray(true, true);
var result = leadingZeros.Concat(bytesWithoutLeadingZeros).ToArray();
return result;
}
+1
View File
@@ -2,6 +2,7 @@
<Import Project="..\..\default.props" />
<PropertyGroup>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
+3 -1
View File
@@ -24,7 +24,9 @@ namespace Framework.IO
deflateStream.Flush();
}
buffer.WriteBytes(ms.ToArray());
buffer.WriteBytes(BitConverter.GetBytes(adler32).Reverse().ToArray());
var adlerBytes = BitConverter.GetBytes(adler32);
adlerBytes.Reverse();
buffer.WriteBytes(adlerBytes);
return buffer.GetData();
}
+7 -4
View File
@@ -25,9 +25,9 @@ namespace System
public static string ToHexString(this byte[] byteArray, bool reverse = false)
{
if (reverse)
return byteArray.Reverse().Aggregate("", (current, b) => current + b.ToString("X2"));
else
return byteArray.Aggregate("", (current, b) => current + b.ToString("X2"));
byteArray.Reverse();
return byteArray.Aggregate("", (current, b) => current + b.ToString("X2"));
}
public static byte[] ToByteArray(this string str, bool reverse = false)
@@ -40,7 +40,10 @@ namespace System
string temp = String.Concat(str[i * 2], str[i * 2 + 1]);
res[i] = Convert.ToByte(temp, 16);
}
return reverse ? res.Reverse().ToArray() : res;
if (reverse)
res.Reverse();
return res;
}
public static byte[] ToByteArray(this string value, char separator)
+1 -1
View File
@@ -1449,4 +1449,4 @@ namespace Game.Chat
handler.SendSysMessage($"Map Id: {map.GetId()} Name: '{map.GetMapName()}' Instance Id: {map.GetInstanceId()} Highest Guid Creature: {map.GetMaxLowGuid(HighGuid.Creature)} GameObject: {map.GetMaxLowGuid(HighGuid.GameObject)}");
}
}
}
}
+1
View File
@@ -2,6 +2,7 @@
<Import Project="..\..\default.props" />
<PropertyGroup>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
+1
View File
@@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<ApplicationIcon>Blue.ico</ApplicationIcon>
<StartupObject>WorldServer.Server</StartupObject>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>