write to error if all pools are empty in py3 mmf
@@ -109,6 +109,16 @@ with grpc.insecure_channel(api_conn_info) as channel:
print("======== MMF results:")
pp.pprint(mo)
+ # Return error when there are no players in the pools
+ num_players_total = 0
+ for _, pool in player_pools.items():
+ num_players_total += len(pool)
+ if num_players_total == 0:
+ if cfg['debug']:
+ print("All player pools are empty, writing to error to skip the evaluator")
+ mo.id = os.environ["MMF_ERROR_ID"]
+ mo.error = "insufficient players"
+
# Step 6 - Write the outcome of the matchmaking logic back to state storage.
# Step 7 - Remove the selected players from consideration by other MMFs.
# CreateProposal does both of these for you, and some other items as well.
