update README with build/run notes

This commit is contained in:
Iris Lightshard 2021-08-03 23:31:32 -06:00
parent 2227876138
commit adc35a5537
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

View file

@ -39,14 +39,7 @@ 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. * `/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.
## configuration ### realm format
`config.h` in the source contains the following configuration macros:
* `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
Each realm directory on the server should have the following files: Each realm directory on the server should have the following files:
@ -54,3 +47,32 @@ Each realm directory on the server should have the following files:
* `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. * `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... 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:
* `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 `/`
## build/run
`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
```