summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-13 14:57:06 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-13 14:57:06 +0200
commitcc815bba50bd5a71106430e1261b39f918f9187b (patch)
tree34a27efd2bb5a737250836c379ab9ef31fdf57d8 /server.js
parent2d0036ff4af20b2ba3da19e269a20b65c04943fb (diff)
downloadbridge-cc815bba50bd5a71106430e1261b39f918f9187b.tar.gz
bridge-cc815bba50bd5a71106430e1261b39f918f9187b.zip
send search success notif to web on every lookup
Diffstat (limited to 'server.js')
-rw-r--r--server.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/server.js b/server.js
index 2f5fcd7..66c4af5 100644
--- a/server.js
+++ b/server.js
@@ -106,6 +106,9 @@ async function searchPlayerInRegion(region, name, id) {
if (!found) return [];
+ // notify web that data is being loaded
+ await ch.publish("amq.topic", "player." + name,
+ new Buffer("search_success"));
// players.length will be 1 in 99.9% of all cases
// - but this will cover the 0.01% too
//
@@ -133,10 +136,7 @@ async function searchPlayer(name) {
grabPlayer(p.attributes.name, p.attributes.shardId, undefined, p.id)));
}));
// notify web
- if (found)
- await ch.publish("amq.topic", "player." + name,
- new Buffer("search_success"));
- else
+ if (!found)
await ch.publish("amq.topic", "player." + name,
new Buffer("search_fail"));
}