Skip to content
Snippets Groups Projects
Commit 239e7093 authored by Florian Schröder's avatar Florian Schröder
Browse files

Update command instructions and enhance error handling

The README.md file has been updated with revised instructions on initiating game server and GUI, specifically the inclusion of manager_ids as arguments. The argument type for manager_ids in utils.py is also altered from list to string. Exception handling in overcooked_gui.py has been improved to explicitly throw a value error when encountering forbidden requests.
parent 8d82c086
No related branches found
No related tags found
No related merge requests found
Pipeline #44868 passed
......@@ -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
......
......@@ -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"]
......
......@@ -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.",
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment