From 1497132c3dc7a44a93309bbf9d21743a9429fbac Mon Sep 17 00:00:00 2001 From: Jon <> Date: Wed, 21 Aug 2024 17:49:25 +0100 Subject: [PATCH] Only reassign bot clients when something has changed --- GuildWarsPartySearch.NodeJSServer/server.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GuildWarsPartySearch.NodeJSServer/server.mjs b/GuildWarsPartySearch.NodeJSServer/server.mjs index d111df4..f84b877 100644 --- a/GuildWarsPartySearch.NodeJSServer/server.mjs +++ b/GuildWarsPartySearch.NodeJSServer/server.mjs @@ -336,6 +336,7 @@ function on_recv_parties(ws, data) { data.district_region = region_from_district(data.district); } const district_region = to_number(data.district_region); + const map_changed = bot_client.map_id !== map_id || bot_client.district_region !== district_region; bot_client.map_id = map_id; bot_client.district_region = district_region; // NB: don't give a shit about language @@ -369,7 +370,8 @@ function on_recv_parties(ws, data) { Object.keys(maps_affected).forEach((map_id) => { send_map_parties(to_number(map_id)); }); - reassign_bot_clients(); + if(map_changed) + reassign_bot_clients(); } /**