fix(core): Converts BB packets (#406)

- [X] Organizes and splits up bulletin boards
- [X] Converts packets
This commit is contained in:
Kamron Batman 2021-01-13 22:28:31 -08:00 • committed by GitHub
parent bae568d856
commit c58aad733d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 952 additions and 737 deletions

View file

@ -21,6 +21,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using Server;
using Server.Network;
using Server.Text;
namespace System.Buffers
@ -50,7 +51,7 @@ namespace System.Buffers
public int Capacity => _buffer.Length;
public ReadOnlySpan<byte> Span => _buffer.Slice(0, Position);
public ReadOnlySpan<byte> Span => _buffer.SliceToLength(Position);
public Span<byte> RawBuffer => _buffer;
@ -78,7 +79,7 @@ namespace System.Buffers
var newSize = Math.Max(BytesWritten + additionalCapacity, _buffer.Length * 2);
byte[] poolArray = ArrayPool<byte>.Shared.Rent(newSize);
_buffer.Slice(0, BytesWritten).CopyTo(poolArray);
_buffer.SliceToLength(BytesWritten).CopyTo(poolArray);
byte[]? toReturn = _arrayToReturnToPool;
_buffer = _arrayToReturnToPool = poolArray;