Skip to content

Commit

Permalink
Assign remaining bots wherever to avoid doubling up on outposts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon committed Sep 5, 2024
1 parent d92afe6 commit 15d720d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions GuildWarsPartySearch.NodeJSServer/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,21 @@ function reassign_bot_clients(request) {
};
})));

// For remaining bots, assign them where you can
bots_to_reassign.forEach((bot_client) => {
check_district_regions.forEach((district_region) => {
for(let map_id = 0; map_id < map_ids.Count;map_id++) {
if(!isValidOutpost(map_id))
return;
if (is_assigned(map_id, district_region))
return;
if(!is_map_unlocked(bot_client.unlocked_maps || [], map_id))
return;
assign_bot(bot_client, map_id, district_region);
}
});
})

if (bots_to_reassign.length) {
console.log(request, "Bots not assigned!!!", JSON.stringify(bots_to_reassign.map((bot_client) => {
return {
Expand Down

0 comments on commit 15d720d

Please sign in to comment.