fix(core): Converts BB packets (#406)
- [X] Organizes and splits up bulletin boards - [X] Converts packets
This commit is contained in:
parent
bae568d856
commit
c58aad733d
32 changed files with 952 additions and 737 deletions
|
|
@ -18,6 +18,7 @@ using System.Buffers;
|
|||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
|
|
@ -57,7 +58,7 @@ namespace Server
|
|||
throw new OutOfMemoryException(nameof(buffer));
|
||||
}
|
||||
|
||||
sliced.Slice(0, indexOf).CopyTo(buffer.Slice(size));
|
||||
sliced.SliceToLength(indexOf).CopyTo(buffer.Slice(size));
|
||||
size += indexOf;
|
||||
|
||||
if (indexOf == sliced.Length)
|
||||
|
|
@ -96,7 +97,7 @@ namespace Server
|
|||
|
||||
a.Remove(b, comparison, span, out var size);
|
||||
|
||||
var str = span.Slice(0, size).ToString();
|
||||
var str = span.SliceToLength(size).ToString();
|
||||
|
||||
if (chrs != null)
|
||||
{
|
||||
|
|
@ -192,7 +193,7 @@ namespace Server
|
|||
|
||||
if (newLineLength == perLine || newLineLength == span.Length)
|
||||
{
|
||||
list.Add(span.Slice(0, newLineLength).ToString());
|
||||
list.Add(span.SliceToLength(newLineLength).ToString());
|
||||
if (list.Count == maxLines || newLineLength == span.Length)
|
||||
{
|
||||
break;
|
||||
|
|
@ -207,7 +208,7 @@ namespace Server
|
|||
}
|
||||
else if (lineLength > 0 && lineLength <= perLine)
|
||||
{
|
||||
list.Add(span.Slice(0, lineLength - 1).ToString());
|
||||
list.Add(span.SliceToLength(lineLength - 1).ToString());
|
||||
if (list.Count == maxLines)
|
||||
{
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue