fix(core): Adds object help response packets (#336)
This commit is contained in:
parent
c77b5b1462
commit
4b2e4fbd36
5 changed files with 44 additions and 59 deletions
|
|
@ -249,5 +249,23 @@ namespace Server.Network
|
|||
|
||||
ns.Send(ref buffer, writer.Position);
|
||||
}
|
||||
|
||||
public static void SendHelpResponse(this NetState ns, Serial s, string text)
|
||||
{
|
||||
text = text?.Trim() ?? "";
|
||||
|
||||
if (ns == null || text.Length == 0 || !ns.GetSendBuffer(out var buffer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var writer = new CircularBufferWriter(buffer);
|
||||
writer.Write((byte)0xB7);
|
||||
writer.Write((ushort)(9 + text.Length * 2));
|
||||
writer.Write(s);
|
||||
writer.WriteBigUniNull(text);
|
||||
|
||||
ns.Send(ref buffer, writer.Position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue