Skip to content

Commit a897bf7

Browse files
committed
Update to the latest spec
1 parent a2aef78 commit a897bf7

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

rlbot/managers/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def set_game_state(
246246
self,
247247
balls: dict[int, flat.DesiredBallState] = {},
248248
cars: dict[int, flat.DesiredCarState] = {},
249-
game_info: Optional[flat.DesiredGameInfoState] = None,
249+
match_info: Optional[flat.DesiredMatchInfo] = None,
250250
commands: list[flat.ConsoleCommand] = [],
251251
):
252252
"""
@@ -255,7 +255,7 @@ def set_game_state(
255255
See wiki for a full break down and examples.
256256
"""
257257

258-
game_state = fill_desired_game_state(balls, cars, game_info, commands)
258+
game_state = fill_desired_game_state(balls, cars, match_info, commands)
259259
self._game_interface.send_game_state(game_state)
260260

261261
def set_loadout(self, loadout: flat.PlayerLoadout):

rlbot/managers/hivemind.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def set_game_state(
260260
self,
261261
balls: dict[int, flat.DesiredBallState] = {},
262262
cars: dict[int, flat.DesiredCarState] = {},
263-
game_info: Optional[flat.DesiredGameInfoState] = None,
263+
match_info: Optional[flat.DesiredMatchInfo] = None,
264264
commands: list[flat.ConsoleCommand] = [],
265265
):
266266
"""
@@ -269,7 +269,7 @@ def set_game_state(
269269
See wiki for a full break down and examples.
270270
"""
271271

272-
game_state = fill_desired_game_state(balls, cars, game_info, commands)
272+
game_state = fill_desired_game_state(balls, cars, match_info, commands)
273273
self._game_interface.send_game_state(game_state)
274274

275275
def set_loadout(self, loadout: flat.PlayerLoadout, spawn_id: int):

rlbot/managers/match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def set_game_state(
268268
self,
269269
balls: dict[int, flat.DesiredBallState] = {},
270270
cars: dict[int, flat.DesiredCarState] = {},
271-
game_info: Optional[flat.DesiredGameInfoState] = None,
271+
match_info: Optional[flat.DesiredMatchInfo] = None,
272272
commands: list[flat.ConsoleCommand] = [],
273273
):
274274
"""
@@ -277,7 +277,7 @@ def set_game_state(
277277
See wiki for a full break down and examples.
278278
"""
279279

280-
game_state = fill_desired_game_state(balls, cars, game_info, commands)
280+
game_state = fill_desired_game_state(balls, cars, match_info, commands)
281281
self.rlbot_interface.send_game_state(game_state)
282282

283283
def shut_down(self, use_force_if_necessary: bool = True):

rlbot/managers/script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def set_game_state(
213213
self,
214214
balls: dict[int, flat.DesiredBallState] = {},
215215
cars: dict[int, flat.DesiredCarState] = {},
216-
game_info: Optional[flat.DesiredGameInfoState] = None,
216+
match_info: Optional[flat.DesiredMatchInfo] = None,
217217
commands: list[flat.ConsoleCommand] = [],
218218
):
219219
"""
@@ -222,7 +222,7 @@ def set_game_state(
222222
See wiki for a full break down and examples.
223223
"""
224224

225-
game_state = fill_desired_game_state(balls, cars, game_info, commands)
225+
game_state = fill_desired_game_state(balls, cars, match_info, commands)
226226
self._game_interface.send_game_state(game_state)
227227

228228
def set_loadout(self, loadout: flat.PlayerLoadout, spawn_id: int):

rlbot/utils/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def fill_desired_game_state(
77
balls: dict[int, flat.DesiredBallState] = {},
88
cars: dict[int, flat.DesiredCarState] = {},
9-
game_info: Optional[flat.DesiredGameInfoState] = None,
9+
match_info: Optional[flat.DesiredMatchInfo] = None,
1010
commands: list[flat.ConsoleCommand] = [],
1111
) -> flat.DesiredGameState:
1212
"""
@@ -15,19 +15,21 @@ def fill_desired_game_state(
1515
"""
1616

1717
game_state = flat.DesiredGameState(
18-
game_info_state=game_info, console_commands=commands
18+
match_info=match_info, console_commands=commands
1919
)
2020

2121
if balls:
2222
max_entry = max(balls.keys())
23+
default_ball = flat.DesiredBallState()
2324
game_state.ball_states = [
24-
balls.get(i, flat.DesiredBallState()) for i in range(max_entry + 1)
25+
balls.get(i, default_ball) for i in range(max_entry + 1)
2526
]
2627

2728
if cars:
2829
max_entry = max(cars.keys())
30+
default_car = flat.DesiredCarState()
2931
game_state.car_states = [
30-
cars.get(i, flat.DesiredCarState()) for i in range(max_entry + 1)
32+
cars.get(i, default_car) for i in range(max_entry + 1)
3133
]
3234

3335
return game_state

tests/run_forever.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
while match_manager.packet.match_info.match_phase != flat.MatchPhase.Ended:
5454
if match_manager.packet.match_info.match_phase == flat.MatchPhase.Countdown:
5555
match_manager.set_game_state(
56-
game_info=flat.DesiredGameInfoState(game_speed=2)
56+
match_info=flat.DesiredMatchInfo(game_speed=2)
5757
)
5858

5959
sleep(1)

0 commit comments

Comments
 (0)