diff --git a/Projects/Benchmarks/Benchmarks/Packets/GumpPackets.cs b/Projects/Benchmarks/Benchmarks/Packets/GumpPackets.cs index be305fa48..74888fd37 100644 --- a/Projects/Benchmarks/Benchmarks/Packets/GumpPackets.cs +++ b/Projects/Benchmarks/Benchmarks/Packets/GumpPackets.cs @@ -16,6 +16,7 @@ namespace Server.Tests void AppendLayout(bool val); void AppendLayout(int val); void AppendLayout(uint val); + void AppendLayout(Serial serial); void AppendLayoutNS(int val); void AppendLayout(string text); void AppendLayoutNS(string text); @@ -89,6 +90,8 @@ namespace Server.Tests m_Layout.Write(m_Buffer, 0, bytes); } + public void AppendLayout(Serial serial) => AppendLayout(serial.Value); + public void AppendLayoutNS(int val) { var toString = val.ToString(); @@ -232,6 +235,8 @@ namespace Server.Tests m_LayoutLength += bytes; } + public void AppendLayout(Serial serial) => AppendLayout(serial.Value); + public void AppendLayoutNS(int val) { var toString = val.ToString(); diff --git a/Projects/Benchmarks/Benchmarks/Packets/PacketTestUtilities.cs b/Projects/Benchmarks/Benchmarks/Packets/PacketTestUtilities.cs index 757495040..e7a01619f 100644 --- a/Projects/Benchmarks/Benchmarks/Packets/PacketTestUtilities.cs +++ b/Projects/Benchmarks/Benchmarks/Packets/PacketTestUtilities.cs @@ -14,7 +14,7 @@ namespace Benchmarks [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Write(this Span data, ref int pos, Serial serial) { - BinaryPrimitives.WriteUInt32BigEndian(data.Slice(pos, 4), serial); + BinaryPrimitives.WriteUInt32BigEndian(data.Slice(pos, 4), serial.Value); pos += 4; } diff --git a/Projects/Benchmarks/Benchmarks/Packets/PacketWriter.cs b/Projects/Benchmarks/Benchmarks/Packets/PacketWriter.cs index bd85aa27c..696dbc7e8 100644 --- a/Projects/Benchmarks/Benchmarks/Packets/PacketWriter.cs +++ b/Projects/Benchmarks/Benchmarks/Packets/PacketWriter.cs @@ -111,6 +111,8 @@ namespace Server.Network UnderlyingStream.Write(m_Buffer, 0, 2); } + public void Write(Serial serial) => Write(serial.Value); + /// /// Writes a 4-byte signed integer value to the underlying stream. ///