Cleaned up websockets

This commit is contained in:
erik 2025-05-09 23:07:24 +02:00
parent 56b09f509a
commit 33fb228654
2 changed files with 45 additions and 26 deletions

View file

@ -193,6 +193,19 @@ namespace MosswartMassacre
var json = JsonConvert.SerializeObject(envelope);
await SendEncodedAsync(json, CancellationToken.None);
}
public static async Task SendSpawnAsync(string nsCoord, string ewCoord, string monster)
{
var envelope = new
{
type = "spawn",
mob = monster,
ns = nsCoord,
ew = ewCoord
};
var json = JsonConvert.SerializeObject(envelope);
await SendEncodedAsync(json, CancellationToken.None);
}
// ─── shared send helper with locking ───────────────