diff --git a/README.md b/README.md index 5efce20..9034fb4 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,15 @@ This is the working structure of the 9p filesystem: * `/grandom`: Read-only, get a random number from 0 to 99 -- These are doled out on a per-realm basis, and the number stays the same until everyone in the realm has had a chance to read it. If you've already read it this round or aren't in a realm, it will be empty. +### realm format + +Each realm directory on the server should have the following files: + + * `realm`: Basic data for the realm, file should contain only the maximum number of members, the master's name, and the password hash, if any (otherwise 0), separated by spaces. + * `universe`: The actual game state for the realm as key value pairs, one per line, like `KEY = VALUE`; limit 15 characters for keys, 63 for values. + +The realm should be synchronized to disc when realm membership, limit, or password change. Fenagling some periodic autosave should be possible... + ## configuration `config.h` in the source contains the following configuration macros: @@ -46,11 +55,24 @@ This is the working structure of the 9p filesystem: * `MAX_USERS`: the maximum number of simultaneous users able to attach to the `xrxs` service * `DATA_DIR`: the path to the root of the cartridge and realm storage; can be absolute or relative to the `xrxs` executable, but must have the trailing `/` -## realm format +## build/run -Each realm directory on the server should have the following files: +`xrxs` is built/tested in a Linux environment with `plan9port` and the C standard library as the only dependencies. With minimal modifications it will probably run just as well on *BSD, WSL, and MacOS. + +Running `./build.sh` from the repository root should build the `xrxs` executable. + +You can run a local server (for testing, split-screen games, or single-player games) with: +``` +./xrxs -m /path/to/mountpoint +``` + +or expose a service on the network (uses `9pserve` to support multiple users and gracefully handle disconnects) with: +``` +./xrxs-srv.sh start +``` + +Similarly, you can stop the service with: +``` +./xrxs-srv.sh stop +``` - * `realm`: Basic data for the realm, file should contain only the maximum number of members, the master's name, and the password hash, if any (otherwise 0), separated by spaces. - * `universe`: The actual game state for the realm as key value pairs, one per line, like `KEY = VALUE`; limit 15 characters for keys, 63 for values. - -The realm should be synchronized to disc when realm membership, limit, or password change. Fenagling some periodic autosave should be possible... \ No newline at end of file