Skip to content

Commit 239215a

Browse files
committed
Move self.rlbot_interface.run(...) into self.connect(...)
1 parent 13b1654 commit 239215a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ pyrightconfig.json
175175

176176
# End of https://www.toptal.com/developers/gitignore/api/python
177177

178+
uv.lock
178179
.vscode/
179180
*.obj
180181
RLBotServer*

rlbot/managers/match.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def connect(
9393
rlbot_server_ip=rlbot_server_ip,
9494
rlbot_server_port=rlbot_server_port or self.rlbot_server_port,
9595
)
96+
self.rlbot_interface.run(background_thread=True)
9697

9798
def wait_for_first_packet(self):
9899
while self.packet is None or self.packet.match_info.match_phase in {
@@ -122,7 +123,6 @@ def start_match(
122123
wants_ball_predictions=False,
123124
close_between_matches=False,
124125
)
125-
self.rlbot_interface.run(background_thread=True)
126126

127127
self.rlbot_interface.start_match(config)
128128

@@ -136,7 +136,7 @@ def start_match(
136136

137137
def disconnect(self):
138138
"""
139-
Disconnect from the RLBotServer.
139+
Disconnect from RLBotServer.
140140
Note that the server will continue running as long as Rocket League does.
141141
"""
142142
self.rlbot_interface.disconnect()
@@ -167,8 +167,8 @@ def shut_down(self, use_force_if_necessary: bool = True):
167167

168168
self.logger.info("Shutting down RLBot...")
169169

170-
# In theory this is all we need for the server to cleanly shut itself down
171170
try:
171+
# In theory this is all we need for the server to cleanly shut itself down
172172
self.rlbot_interface.stop_match(shutdown_server=True)
173173
except BrokenPipeError:
174174
match gateway.find_server_process(self.main_executable_name)[0]:

0 commit comments

Comments
 (0)