fix(core): Converts account packets to spanwriter (#381)
- [X] Converts account packets to spanwriter
This commit is contained in:
parent
3b413371dc
commit
ac76c57c39
7 changed files with 157 additions and 117 deletions
|
|
@ -28,12 +28,12 @@ namespace Server.Network
|
|||
|
||||
public static void SendArrow(this NetState ns, byte command, int x, int y, Serial s)
|
||||
{
|
||||
if (ns == null || !ns.GetSendBuffer(out var buffer))
|
||||
if (ns == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var writer = new CircularBufferWriter(buffer);
|
||||
var writer = new SpanWriter(stackalloc byte[10]);
|
||||
writer.Write((byte)0xBA); // Packet ID
|
||||
writer.Write(command);
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ namespace Server.Network
|
|||
writer.Write((short)-1);
|
||||
}
|
||||
|
||||
ns.Send(ref buffer, writer.Position);
|
||||
ns.Send(writer.Span);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue