summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
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"));
}