fix: Fixes spawner timer deserialization, decimal deserialization, and adds potion keg reverse lookup (#1711)
### Summary * Fixes spawner timer deserialization * Adds a check for a null timer and allows the timer to get recreated * Adds PotionKeg reverse lookup * Heavily optimizes decimal serialize/deserialize
This commit is contained in:
parent
70575e1517
commit
1a7e7c7c70
7 changed files with 126 additions and 49 deletions
|
|
@ -19,6 +19,7 @@ using System.Collections.Concurrent;
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Server.Text;
|
||||
|
||||
|
|
@ -290,6 +291,15 @@ public class BufferWriter : IGenericWriter
|
|||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Write(decimal value)
|
||||
{
|
||||
Span<int> buffer = stackalloc int[sizeof(decimal) / 4];
|
||||
decimal.GetBits(value, buffer);
|
||||
|
||||
Write(MemoryMarshal.Cast<int, byte>(buffer));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal void InternalWriteString(string value)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue