OCW Game Server#
Open Course World#
Open Course world is a Course World server that is compatible with Super Mario Maker 2. To play levels, you can connect through the Ryujinx emulator or a Switch modded with Atmosphère. Alternatively, you can use the website to set up a maker account, browse makers and courses, or import and manage your own courses with our import tool.
Game Server#
Code that makes up the Super Mario Maker 2 compatible server.
Set up a dev environment#
Documentation of the configuration options can be found in scripts/defaults.sh. Each of these can be overridden using the syntax VAR=value in a .env file, or overridden in your environment by other means, such as direnv.
The Database#
We use CockroachDB for our database, which should be run through Docker. Once you have set up docker, run:
./scripts/db-start.sh
to start the docker container for the database.
To restore a backup from production to your local database, you will need an AWS access key and secret. Put these in your .env:
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
and run ./scripts/db-restore-aws.sh from the project root.
Auth#
In order to log in via Twitch and/or Discord, you will need to obtain client secrets from the team. Add them to your .env:
export DISCORD_CLIENT_SECRET=...
export TWITCH_CLIENT_SECRET=...
The App#
Once the database is running, run the app with ./scripts/app.sh:
$ ./scripts/app.sh
Once you have your server running, you can point your frontend to the http url configured in your env - by default, http://localhost:6001.
Connecting Ryujinx#
In order to connect Ryujinx to your local server, you must build a version yourself with SSL verification patched out. This is available on our Ryujinx fork, which we try to keep reasonably up to date. Alternatively, the patch can be found in this repository at ryujinx/ryujinx_disable_ssl_verify_for_local_testing.patch.
Game Client Mod#
client-mod and releases
Running With Docker (recommended for Windows)#
Setup#
Before we get running with docker, you will need to:
- Install Docker.
- Create a file in the project called
.env- you can place config overrides here. - Open a terminal and
cdordirinto the project root.
Running#
- Build the containers with
docker compose build. - Run
docker compose upand all the services will start. - To restart, quit the server using Ctrl-C and run both the above commands again.
- For faster restarts, it's recommended to run the db in a separate terminal with
docker compose up db. You can then run the app withdocker compose build appanddocker compose run app. Run both commands to restart when you've made code changes.
Scripts#
- To run scripts, use
docker compose exec app bash, ordocker compose exec app ./scripts/some-script.sh.- For example, to run a database console, use
docker compose exec app ./scripts/db-console.sh - To print
ocw-config.jsonfor the dev user, usedocker compose exec app ./scripts/ocw-api.sh ocw-config.json - You can do similar for other scripts documented above.
- For example, to run a database console, use
- If the app isn't running, use
docker compose run --rmin place ofdocker compose exec. This will create a temporary container for running scripts in.