feat: Adds Network Packet Documentation (#2302)

This commit is contained in:
Kamron Batman 2026-01-01 17:52:56 -08:00 committed by GitHub
parent ec287d7691
commit 1a7c94a442
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 24753 additions and 22 deletions

View file

@ -56,12 +56,10 @@ public static class OutgoingPlayerPackets
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void SendChangeUpdateRange(this NetState ns, byte range) =>
ns?.Send(stackalloc byte[] { 0xC8, range });
public static void SendChangeUpdateRange(this NetState ns, byte range) => ns?.Send(stackalloc byte[] { 0xC8, range });
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void SendDeathStatus(this NetState ns) =>
ns?.Send(stackalloc byte[] { 0x2C, 2 });
public static void SendDeathStatus(this NetState ns) => ns?.Send(stackalloc byte[] { 0x2C, 2 });
public static void SendDisplayProfile(this NetState ns, Serial m, string header, string body, string footer)
{

View file

@ -29,9 +29,7 @@ public enum TradeFlag : byte
public static class OutgoingSecureTradePackets
{
public static void SendDisplaySecureTrade(
this NetState ns, Mobile them, Container first, Container second, string name
)
public static void SendDisplaySecureTrade(this NetState ns, Mobile them, Container first, Container second, string name)
{
if (ns.CannotSendPackets())
{

View file

@ -57,15 +57,18 @@ public static class GenCommands
options
);
var template = File.ReadAllText(Path.Combine(Core.BaseDirectory, "Data", "commands.html"))
// Template is in Distribution/Data/commands
var templatePath = Path.Combine(Core.BaseDirectory, "Data", "commands", "template.html");
var template = File.ReadAllText(templatePath)
.Replace("<!-- COMMANDS -->", commandsJson.EscapeHtml())
.Replace("<!-- MODIFIERS -->", modifiersJson.EscapeHtml());
// Write the new file to the web folder
// Output to Distribution/web folder (typically ignored by servers for external systems)
var webFolder = Path.Combine(Core.BaseDirectory, "web");
PathUtility.EnsureDirectory(webFolder);
var webPath = Path.Combine(webFolder, "commands.html");
File.WriteAllText(webPath, template, Encoding.UTF8);
e.Mobile.SendMessage($"Commands webpage generated at {webPath}.");
Directory.CreateDirectory(webFolder);
var outputPath = Path.Combine(webFolder, "commands.html");
File.WriteAllText(outputPath, template, Encoding.UTF8);
e.Mobile.SendMessage($"Commands webpage generated at {outputPath}.");
}
}