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 1010RLBOT_SERVER_FOLDER = DIR / "../../core/RLBotCS/bin/Release/"
1111
1212if __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
1416
15- match_manager .start_match (MATCH_CONFIG_PATH )
16- assert match_manager .packet is not None
17-
18- try :
1917 # 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 :
2119 sleep (1.0 )
22- finally :
23- match_manager .shut_down ()
Original file line number Diff line number Diff line change 1414 match_config_path = Path (sys .argv [1 ])
1515 assert match_config_path .exists (), f"Match config not found: { match_config_path } "
1616
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 )
2019
21- # wait
22- input ("\n Press enter to end the match: " )
20+ # Wait for input
21+ input ("\n Press enter to end the match: " )
2322
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