Website Integrations¶
This section documents the integration points between the game servers and the website/external services.
Player API V2¶
The Player API is an internal HTTP server running on the Survival Mix server via Skript (player-api.sk). It allows the website and other services to query real-time player data.
- Port:
12002 - Method:
GETfor all endpoints - Source File:
server_configs/survivalmix/plugins/Skript/scripts/player-api.sk
Endpoints¶
GET /api/lastlogout/{player_name}¶
Returns the last logout timestamp for a player. Used to display "Last Seen" on profile pages.
Response (200 OK):
{
"name": "PlayerName",
"uuid": "uuid-string",
"last_logout": "Date String",
"relative_time": "2 hours ago",
"timestamp": 1705583920000
}
GET /api/balance/{player_name}¶
Returns the player's economy balance.
Response (200 OK):
GET /api/name/{uuid}¶
Resolves a UUID to the latest known player name.
Response (200 OK):
GET /api/discord/name/{discord_id}¶
Resolves a Discord ID to the linked Minecraft player name. Requires Discordsrv database linkage.
Response (200 OK):
GET /api/discord/id/{player_name}¶
Resolves a Minecraft player name to their linked Discord ID.
Response (200 OK):
GET /api/chat/public¶
Returns the recent public chat history buffer.
Response (200 OK):
Error Handling¶
| Status Code | Description |
|---|---|
| 400 | Bad Request (Missing parameters) |
| 404 | Not Found (Player or ID not found) |
| 500 | Internal Server Error (Plugin missing, DB error) |
Database Connections¶
The API connects to the kaizenmc_discordsrv database to perform Discord ID lookups.
- Connection Variable: {sql::db::player_api}
- Refresh: Automatically reconnects on script load and every 2 hours.