(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
== Server listing protocol == | == Server listing protocol == | ||
For a server to get listed, all Vintage Story servers first register on the server list and then periodically send a heartbeat HTTP request. Clients then retrieve the server list. This all happens through HTTP endpoints. A re-implementation of the masterserver made in Python is available on GitHub: | For a server to get listed, all Vintage Story servers need to first register on the server list and then periodically send a heartbeat HTTP request. Clients will then retrieve the server list. This all happens through HTTP endpoints. A re-implementation of the masterserver made in Python is available on GitHub: | ||
https://github.com/CDWimmer/VintageStoryMasterServer | https://github.com/CDWimmer/VintageStoryMasterServer | ||
Line 36: | Line 36: | ||
"whitelisted":true | "whitelisted":true | ||
} | } | ||
</syntaxhighlight>The <code>gameDescription</code> attribute can contain basic HTML markup like <code><nowiki><h1></nowiki></code> tags and links. | </syntaxhighlight>The <code>gameDescription</code> attribute can contain basic HTML markup like <code><nowiki><h1></nowiki></code> tags and links.<br> | ||
Sample successful response:<syntaxhighlight lang="json"> | Sample successful response:<syntaxhighlight lang="json"> | ||
{ | { | ||
Line 42: | Line 42: | ||
"status": "ok" | "status": "ok" | ||
} | } | ||
</syntaxhighlight>The server token consists of 32 random bytes encoded as base64. | </syntaxhighlight>The server token consists of 32 random bytes encoded as base64.<br> | ||
Sample bad response from the server:<syntaxhighlight lang="json"> | Sample bad response from the server:<syntaxhighlight lang="json"> | ||
{ | { | ||
Line 69: | Line 70: | ||
</syntaxhighlight>When the masterserver replies with a <code>timeout</code> response, the Vintage Story server should re-register their server. | </syntaxhighlight>When the masterserver replies with a <code>timeout</code> response, the Vintage Story server should re-register their server. | ||
== (HTTP GET) View server list == | |||
https://masterserver.vintagestory.at/api/v1/servers/list | https://masterserver.vintagestory.at/api/v1/servers/list | ||
Line 99: | Line 100: | ||
[ ... ] | [ ... ] | ||
} | } | ||
} | |||
</syntaxhighlight> | |||
== Get player information == | |||
Vintage Story has limited, obscure and undocumented API endpoints available to get player information. Make sure to set the <code>Content-Type: application/x-www-form-urlencoded</code> header to all POST requests, otherwise it will fail. The <code>valid</code> attribute seems to always return <code>1</code>. | |||
=== (HTTP POST) Get a player's UID === | |||
Endpoint: https://auth3.vintagestory.at/resolveplayername | |||
Sample url-encoded payload to send:<syntaxhighlight> | |||
playername=lolcat | |||
</syntaxhighlight>Sample response:<syntaxhighlight lang="json"> | |||
{ | |||
"playeruid":"HoTGuCSFEkJtltbThBSmzKy2", | |||
"valid":1 | |||
} | |||
</syntaxhighlight> | |||
=== (HTTP POST) Get a player's name by UID === | |||
Endpoint: https://auth2.vintagestory.at/resolveplayeruid | |||
Sample url-encoded payload to send:<syntaxhighlight> | |||
uid=UOykyPSlZsMvjEjZZa%2B7409L | |||
</syntaxhighlight>Sample response:<syntaxhighlight lang="json"> | |||
{ | |||
"playername":"Tyron", | |||
"valid":1 | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 05:39, 5 June 2025

Vintage Story
Vintage Story is a voxel-based wilderness survival game written in C#.
Server listing protocol
For a server to get listed, all Vintage Story servers need to first register on the server list and then periodically send a heartbeat HTTP request. Clients will then retrieve the server list. This all happens through HTTP endpoints. A re-implementation of the masterserver made in Python is available on GitHub:
https://github.com/CDWimmer/VintageStoryMasterServer
(HTTP POST) Register server
Endpoint: https://masterserver.vintagestory.at/api/v1/servers/register
Sample JSON payload:
{
"port":42424,
"name":"My cool vintage story server",
"icon":"",
"playstyle":{
"id":"surviveandbuild",
"langCode":"preset-surviveandbuild"
},
"maxPlayers":48,
"gameVersion":"1.20.3",
"hasPassword":false,
"Mods":[
{
"id":"signs",
"version":"1.0.2"
},
[ ... ]
],
"serverUrl":"https://lolcat.ca",
"gameDescription":"Some description here",
"whitelisted":true
}
The gameDescription
attribute can contain basic HTML markup like <h1>
tags and links.
Sample successful response:
{
"data": "server-token-here",
"status": "ok"
}
The server token consists of 32 random bytes encoded as base64.
Sample bad response from the server:
{
"status": "bad",
"data": "port not opened"
}
If you have any deduction skills, you will see that in order to get listed, you need to host a Vintage Story server on the same host the request is originating from before attempting to create a list entry.
(HTTP POST) Heartbeat request
https://masterserver.vintagestory.at/api/v1/servers/heartbeat
Sample JSON payload:
{
"token": "your-token-here",
"players": 500
}
Sample successful response:
{
"status": "ok"
}
Sample bad response from the server:
{
"status": "timeout",
"data": "timeout"
}
When the masterserver replies with a timeout
response, the Vintage Story server should re-register their server.
(HTTP GET) View server list
https://masterserver.vintagestory.at/api/v1/servers/list
Sample JSON response:
{
"status": "ok",
"data": {
[
"serverName": "Vintage Story Server",
"serverIP": "1.1.1.1:25209",
"playstyle": {
"id": "surviveandbuild",
"langCode": "preset-surviveandbuild"
},
"mods": {
[
"id": "primitivesurvival",
"version": "3.7.5"
],
[ ... ]
}
"maxPlayers": "16",
"players": 10,
"gameVersion": "1.20.1",
"hasPassword": false,
"whitelisted": true,
"gameDescription": "Some description here"
],
[ ... ]
}
}
Get player information
Vintage Story has limited, obscure and undocumented API endpoints available to get player information. Make sure to set the Content-Type: application/x-www-form-urlencoded
header to all POST requests, otherwise it will fail. The valid
attribute seems to always return 1
.
(HTTP POST) Get a player's UID
Endpoint: https://auth3.vintagestory.at/resolveplayername
Sample url-encoded payload to send:
playername=lolcat
Sample response:
{
"playeruid":"HoTGuCSFEkJtltbThBSmzKy2",
"valid":1
}
(HTTP POST) Get a player's name by UID
Endpoint: https://auth2.vintagestory.at/resolveplayeruid
Sample url-encoded payload to send:
uid=UOykyPSlZsMvjEjZZa%2B7409L
Sample response:
{
"playername":"Tyron",
"valid":1
}