Fix ring buffer
This commit is contained in:
parent
e70a04ac16
commit
c9c2b45b2a
17 changed files with 330 additions and 135 deletions
45
README.md
Normal file
45
README.md
Normal file
|
@ -0,0 +1,45 @@
|
|||
# craftflut
|
||||
|
||||
Alternative gateway implementation for https://codeberg.org/MoKe12g/Pixelflut3D
|
||||
|
||||
## Building
|
||||
|
||||
A minimum Zig version of 0.14.0 is required.
|
||||
|
||||
```
|
||||
zig build -Doptimize=(ReleaseSafe|ReleaseFast) -Dmaterial_max_len=(<int>, default: 40)
|
||||
```
|
||||
|
||||
## CLI options
|
||||
|
||||
- `--unix-socket`: Path to Unix socket to send block updates to
|
||||
- `--queue`: Block update queue capacity (default: `1024`)
|
||||
- `--web-port`: Web server port
|
||||
- `--web-threads`: Web server thread count (default: `1`)
|
||||
|
||||
## API
|
||||
|
||||
TODO: Classic Pixelflut TCP
|
||||
|
||||
### HTTP
|
||||
|
||||
| Path | Method | Headers | Body | Response | Description |
|
||||
| ------------ | ------ | ------- | -------------------------------------------------------------------- | ------------- | --------------------------- |
|
||||
| `/api/block` | `PUT` | | `{"dimension":<i32>,"x":<i32>,"y":<i32>,"z":<i32>,"material":<str>}` | `201 Created` | Enqueues given block update |
|
||||
|
||||
## Gateway
|
||||
|
||||
This application relays and batches the received block updates and sends them as CSV data to an existing Unix socket.
|
||||
|
||||
Create a test socket with: `socat -u UNIX-LISTEN:<path>,reuseaddr,fork -`
|
||||
|
||||
### Payload
|
||||
|
||||
Each packet is seperated by a newline (`\n`).
|
||||
|
||||
```
|
||||
dimension,x,y,z,material
|
||||
<int32>,<int32>,<int32>,<int32>,<str>
|
||||
```
|
||||
|
||||
E.g.: `0,42,42,42,dirt` puts a dirt block in dimension `0` (Overworld) at coordinates `42,42,42`.
|
Loading…
Add table
Add a link
Reference in a new issue