File tree Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 10
10
RLBOT_SERVER_FOLDER = DIR / "../../core/RLBotCS/bin/Release/"
11
11
12
12
if __name__ == "__main__" :
13
- match_manager = MatchManager (RLBOT_SERVER_FOLDER )
13
+ with MatchManager (RLBOT_SERVER_FOLDER ) as man :
14
+ man .start_match (MATCH_CONFIG_PATH )
15
+ assert man .packet is not None
14
16
15
- match_manager .start_match (MATCH_CONFIG_PATH )
16
- assert match_manager .packet is not None
17
-
18
- try :
19
17
# wait for the match to end
20
- while match_manager .packet .match_info .match_phase != flat .MatchPhase .Ended :
18
+ while man .packet .match_info .match_phase != flat .MatchPhase .Ended :
21
19
sleep (1.0 )
22
- finally :
23
- match_manager .shut_down ()
Original file line number Diff line number Diff line change 14
14
match_config_path = Path (sys .argv [1 ])
15
15
assert match_config_path .exists (), f"Match config not found: { match_config_path } "
16
16
17
- # start the match
18
- match_manager = MatchManager (RLBOT_SERVER_FOLDER )
19
- match_manager .start_match (match_config_path , False )
17
+ with MatchManager (RLBOT_SERVER_FOLDER ) as man :
18
+ man .start_match (match_config_path , False )
20
19
21
- # wait
22
- input ("\n Press enter to end the match: " )
20
+ # Wait for input
21
+ input ("\n Press enter to end the match: " )
23
22
24
- # end the match and disconnect
25
- match_manager .stop_match ()
26
- match_manager .disconnect ()
23
+ # End the match
24
+ man .stop_match ()
You can’t perform that action at this time.
0 commit comments