summaryrefslogtreecommitdiff
path: root/api.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-21 18:42:09 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-21 18:42:09 +0100
commit0a000528fef098f64887988b41330cf917a0ed7e (patch)
treef13906c47a791966286a6242b7b470110dc6c20c /api.js
parenteffeea65388b116f3ec1a41e7596b39bf3c1d576 (diff)
downloadbridge-0a000528fef098f64887988b41330cf917a0ed7e.tar.gz
bridge-0a000528fef098f64887988b41330cf917a0ed7e.zip
use common format for socket message bodies
Diffstat (limited to 'api.js')
-rw-r--r--api.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/api.js b/api.js
index f24d1bc..8df8f9d 100644
--- a/api.js
+++ b/api.js
@@ -276,7 +276,10 @@ async function listen() {
process_jobs.rows.sort((a, b) => { return a.id < b.id; });
for (let process_job of process_jobs.rows) {
// send a notification for each player name
- io.emit("player processed", process_job.name);
+ io.emit("player processed", {
+ "id": null,
+ "name": process_job.name
+ });
}
if (process_jobs.rows.length > 0) {
last_broadcast_ids.process = process_jobs.rows[0].id;
@@ -294,7 +297,10 @@ async function listen() {
compile_jobs.rows.sort((a, b) => { return a.id < b.id; });
for (let compile_job of compile_jobs.rows) {
// send a notification for each player name
- io.emit("player compiled", compile_job.playerid);
+ io.emit("player compiled", {
+ "id": compile_job.playerid,
+ "name": null
+ });
}
if (compile_jobs.rows.length > 0) {
last_broadcast_ids.compile = compile_jobs.rows[0].id;