@@ -107,6 +107,22 @@ def _try_initialize(self):
107
107
):
108
108
return
109
109
110
+ # Search match configuration for our spawn ids
111
+ for player_id in self .player_ids :
112
+ for player in self .match_config .player_configurations :
113
+ match player .variety .item :
114
+ case flat .CustomBot (name ):
115
+ if player .player_id == player_id :
116
+ self .names .append (name )
117
+ self .loggers .append (get_logger (name ))
118
+ break
119
+ else : # else block runs if break was not hit
120
+ self ._logger .warning (
121
+ "Hivemind with agent id '%s' did not find itself in the match configuration for player id %s" ,
122
+ self ._game_interface .agent_id ,
123
+ player_id ,
124
+ )
125
+
110
126
try :
111
127
self .initialize ()
112
128
except Exception as e :
@@ -125,16 +141,6 @@ def _handle_match_config(self, match_config: flat.MatchConfiguration):
125
141
self .match_config = match_config
126
142
self ._has_match_settings = True
127
143
128
- # Search match settings for our spawn ids
129
- for player_id in self .player_ids :
130
- for player in self .match_config .player_configurations :
131
- match player .variety .item :
132
- case flat .CustomBot (name ):
133
- if player .player_id == player_id :
134
- self .names .append (name )
135
- self .loggers .append (get_logger (name ))
136
- break
137
-
138
144
self ._try_initialize ()
139
145
140
146
def _handle_field_info (self , field_info : flat .FieldInfo ):
@@ -250,7 +256,7 @@ def update_rendering_status(
250
256
):
251
257
"""
252
258
Requests the server to update the status of the ability for this bot to render.
253
- Will be ignored if rendering has been set to AlwaysOff in the match settings .
259
+ Will be ignored if rendering has been set to AlwaysOff in the match configuration .
254
260
If the status is successfully updated, the `self.rendering_status_update` method will be called which will update `self.renderer.can_render`.
255
261
256
262
- `status`: `True` to enable rendering, `False` to disable.
@@ -283,7 +289,7 @@ def handle_match_comm(
283
289
"""
284
290
Called when a match communication message is received.
285
291
See `send_match_comm`.
286
- NOTE: Messages from scripts will have `team == 2` and the index will be its index in the match settings .
292
+ NOTE: Messages from scripts will have `team == 2` and the index will be its index in the match configuration .
287
293
"""
288
294
289
295
def send_match_comm (
@@ -337,7 +343,7 @@ def set_loadout(self, loadout: flat.PlayerLoadout, index: int):
337
343
338
344
def initialize (self ):
339
345
"""
340
- Called when the bot is ready for initialization. Field info, match settings , name, index, and team are
346
+ Called when the bot is ready for initialization. Field info, match configuration , name, index, and team are
341
347
fully loaded at this point, and will not return garbage data unlike in `__init__`.
342
348
"""
343
349
0 commit comments