fix(core): Updates prompt packet (#332)

- [X] Updates prompt packet
This commit is contained in:
Kamron Batman 2020-11-30 23:33:47 -08:00 committed by GitHub
parent 75c1b32513
commit 54b0a7dcb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 75 deletions

View file

@ -17,6 +17,7 @@ using System;
using System.Buffers;
using System.IO;
using System.Runtime.CompilerServices;
using Server.Prompts;
namespace Server.Network
{
@ -230,5 +231,23 @@ namespace Server.Network
ns.Send(ref buffer, 9);
}
public static void SendPrompt(this NetState ns, Prompt prompt)
{
if (ns == null || prompt == null || !ns.GetSendBuffer(out var buffer))
{
return;
}
var writer = new CircularBufferWriter(buffer);
writer.Write((byte)0xC2); // Packet ID
writer.Write((ushort)21);
writer.Write(prompt.Serial);
writer.Write(prompt.Serial);
writer.Write((long)0);
writer.Write((short)0);
ns.Send(ref buffer, writer.Position);
}
}
}