forked from aya/aya
1.8 KiB
1.8 KiB
Aya Masterserver
- Default port: 53600
- Run command:
./masterserver.py --port 53600 --key <optional_auth_key> - Communicates using
application/json - Requires an
Authorizationheader if a key is provided - Missing or invalid key returns
401 Unauthorized - Invalid request returns
400 Bad Request - Responses are always JSON:
{"status": "success" or "error", ...}(includes "error" field including message if except. occurs.)
POST /broadcast
- Registers a new server
- Required fields:
server_host(str): Hostname of the serverserver_name(str): Display name of the serverserver_port(int): Port numberserver_ip(str): Public IP addressplayers(int): Current number of playersmax_players(int): Maximum number of players
- Response:
{"status": "success", "server_id": "<unique_id>"} - Save the
server_idfor future pings
POST/GET /ping
- Updates or verifies a server’s current status
- Checks that the provided IP matches the registered one
- Required fields:
server_id(str): Unique ID from /broadcastserver_name(str): Server nameserver_port(int): Server portserver_ip(str): Server IPserver_host(str): Server hostnameplayers(int): Current playersmax_players(int): Maximum players
GET /health
- Returns basic health information
- Example response:
{"timestamp": "<ISO 8601>", "server_count": <int>}
GET /
- Returns all currently registered servers
- Example response:
{
"servers": [
{
"id": "<string>",
"host": "<string>",
"name": "<string>",
"port": <int>,
"ip": "<string>",
"players": <int>,
"max_players": <int>
}
],
"count": <int>
}