diff --git a/README.md b/README.md index 135e869b284165af0d9eebe765a90478cc7f1f31..4e7e315bc87854f056c643808796056629f27e75 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,17 @@ _The arguments are the defaults. Therefore, they are optional._ You can also start the **Game Server** and the **PyGame GUI** individually in different terminals. ```bash -python3 overcooked_simulator/game_server.py --url "localhost" --port 8000 +python3 overcooked_simulator/game_server.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 SECRETKEY2 -python3 overcooked_simulator/gui_2d_vis/overcooked_simulator.py --url "localhost" --port 8000 +python3 overcooked_simulator/gui_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY1 ``` You can start also several GUIs. +```bash +python3 overcooked_simulator/gui_2d_vis/overcooked_gui.py --url "localhost" --port 8000 --manager_ids SECRETKEY2 +``` + You can replace the GUI with your own GUI (+ study server/matchmaking server). ### Library Installation diff --git a/overcooked_simulator/gui_2d_vis/overcooked_gui.py b/overcooked_simulator/gui_2d_vis/overcooked_gui.py index dd96280b2db2d3f58cf6a1daa9b29460e0d1207b..8e4e4025be52b869e3a753dc01f1eac693429041 100644 --- a/overcooked_simulator/gui_2d_vis/overcooked_gui.py +++ b/overcooked_simulator/gui_2d_vis/overcooked_gui.py @@ -457,6 +457,8 @@ class PyGameGUI: f"{self.request_url}/manage/create_env/", json=creation_json, ) + if env_info.status_code == 403: + raise ValueError(f"Forbidden Request: {env_info.json()['detail']}") env_info = env_info.json() assert isinstance(env_info, dict), "Env info must be a dictionary" self.current_env_id = env_info["env_id"] diff --git a/overcooked_simulator/utils.py b/overcooked_simulator/utils.py index d99d6430b6614ecc299dbc3abe33b6be81c05e72..2d77d32145e43db8bb5c1960067453a970a39080 100644 --- a/overcooked_simulator/utils.py +++ b/overcooked_simulator/utils.py @@ -66,7 +66,9 @@ def url_and_port_arguments(parser): def disable_websocket_logging_arguments(parser): - parser.add_argument("--enable-websocket-logging", action="store_true", default=True) + parser.add_argument( + "--enable-websocket-logging" "", action="store_true", default=True + ) def add_list_of_manager_ids_arguments(parser): @@ -74,7 +76,7 @@ def add_list_of_manager_ids_arguments(parser): "-m", "--manager_ids", nargs="+", - type=list[str], + type=str, default=[uuid.uuid4().hex], help="List of manager IDs that can create environments.", )