Skip to content

Commit 74cf62e

Browse files
committed
MatchManager: only send InitComplete once
1 parent 154991f commit 74cf62e

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

rlbot/managers/match.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class MatchManager:
105105
packet: Optional[flat.GameTickPacket] = None
106106
rlbot_server_process: Optional[psutil.Process] = None
107107
rlbot_server_port = RLBOT_SERVER_PORT
108+
initialized = False
108109

109110
def __init__(
110111
self,
@@ -161,7 +162,10 @@ def start_match(
161162
):
162163
self.logger.info("Python attempting to start match.")
163164
self.rlbot_interface.start_match(match_config, self.rlbot_server_port)
164-
self.rlbot_interface.send_init_complete(flat.InitComplete())
165+
166+
if not self.initialized:
167+
self.rlbot_interface.send_init_complete(flat.InitComplete())
168+
self.initialized = True
165169

166170
if wait_for_start:
167171
self.wait_for_valid_packet()

rlbot/managers/script.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def _initialize_agent(self):
5454
self.initialize_agent()
5555
except Exception as e:
5656
self.logger.critical(
57-
"Script %s failed to initialize due the following error: %s", self.name, e
57+
"Script %s failed to initialize due the following error: %s",
58+
self.name,
59+
e,
5860
)
5961
print_exc()
6062
exit()

tests/necto/bot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from time import sleep
21
import numpy as np
32
import torch
43
from agent import Agent

0 commit comments

Comments
 (0)