X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=game.js;fp=game.js;h=eb1ba807c3e1d9ec5a0e9eda65fceafaff052338;hb=ea4d0802292a43555d5710041a050f6df71c38e0;hp=eb78f31ecbe531a38801cbbb9b4a466eb968d8cc;hpb=1b8674fabbdfab627f12727cdc3616a233cd767a;p=lmno-server diff --git a/game.js b/game.js index eb78f31..eb1ba80 100644 --- a/game.js +++ b/game.js @@ -224,6 +224,10 @@ class Game { this.broadcast_string(`event: ${type}\ndata: ${data}\n`); } + broadcast_event_object(type, obj) { + this.broadcast_event(type, JSON.stringify(obj)); + } + handle_events(request, response) { /* These headers will keep the connection open so we can stream events. */ const headers = {