1
0
Fork 0
forked from CRSS/Website

feat: some website <-> server communications "proposal"

This commit is contained in:
TheClashFruit 2024-08-29 17:29:43 +02:00
parent 0daff3ecfa
commit 60a53467b2
Signed by: TheClashFruit
GPG key ID: 09BB24C34C2F3204
2 changed files with 31 additions and 1 deletions

View file

@ -10,4 +10,6 @@ DB_PASS=
DB_HOST=
DB_PORT=
AUTH_SECRET=
AUTH_SECRET=
MC_API=

28
docs/crss_server_api.md Normal file
View file

@ -0,0 +1,28 @@
# The CRSS Mod <-> CRSS Website Communication API
A layer bellow the website api to retrieve and send data to the CRSS server. For example a user requests `https://crss.cc/api/v1/server/players`, the website api will call the crss mod api to get the data from the server.
It will use not use http for reasons.
## Packets
### Get Server Info
#### Client -> Server
| Identifier | Lenght |
|------------|-----------------------|
| `0x00` | `0x00 0x00 0x00 0x00` |
* Identifier (1 Byte) - `0x00`
* Length (4 Bytes) - `UInt32`
#### Server -> Client
| Identifier | Lenght | Data |
|------------|-----------------------|-----------|
| `0x00` | `0x00 0x00 0x00 0x00` | `{ ... }` |
* Identifier (1 Byte) - `0x00`
* Length (4 Bytes) - `UInt32`
* Data (*Lenght) - `String` - JSON Object