VintageStory MasterServer
A homemade reproduction of the VintageStory Master Server as a Django app, making the server list available to the rest of your project.
What is a "master server"? It's what allows the server browser to work. Essentially a catalogue that game servers register with so players can discover them.
Why? Besides haunting some individuals on the VS Discord server? Because I can. Personally, I use this to show a marker on my personal website for when my game server is online. The limit is merely your imagination.
Why not Python 3.xyz? More than likely this will work on your Python version, I've just not tested it. Please tell me if it works for you!
Installation
pip install vintagestory-masterserver
Add to your installed apps in project/settings.py:
INSTALLED_APPS = [
...,
'vintagestory_masterserver',
]
Modify project/urls.py to add the urls:
urlpatterns = [
...,
path("vsmaster/", include("vsmaster.urls"))
]
Obviously you can change "vsmaster/" to your preferred choice, but be aware this readme will use this in all examples.
Please remember to then run python manage.py makemigrations and migrate.
Usage
Verify it is working:
curl http://127.0.0.1:8000/vsmaster/list
example output:
{"status": "ok", "data": [{"serverName": "VintageStory Server", "serverIP": "127.0.0.1:42420", "playstyle": {"id": "surviveandbuild", "langCode": "surviveandbuild-bands"}, "Mods": [{"id": "game", "version": "1.20.3"}, {"id": "betterruins", "version": "0.4.6"}], "maxPlayers": 16, "gameVersion": "1.20.3", "hasPassword": true, "whitelisted": true, "gameDescription": "A Vintage Story Server"}]}
Get a list of all servers with heartbeats within the last 6 minutes:
servers = VSServer.objects.filter(last_heartbeat__gte=timezone.now()-timezone.timedelta(minutes=6))
Modifying game server config
In serverconfig.json, modify the MasterserverUrl line to point to your base url.
e.g. "MasterserverUrl": "http://127.0.0.1:8000/vsmaster/".
The location of the config file will depend on your operating system and the particulars of your set up, but if you're reading this I sure hope you've figured that out already.
Modifying game client config
There is no in-game UI to change this so you'll need to locate your settings file.
On Windows, this defaults to %APPDATA%\VintageStoryData\clientsettings.json.
Change the masterserverUrl line to direct to your own root url, e.g.: "masterserverUrl": "http://127.0.0.1:8000/vsmaster/"
n.b. doing this will obviously prevent you from seeing the normal public server list in-game. You may still connect to any server for which you have the address. You can always change it back later.
Background
This API attempts to replicate everything I could observe the game server and client querying, and the sort of responses I could get from the official master server.
I should say I had some light assistance/encouragement from a couple of strange people in the official VintageStory Discord guild whilst figuring this out.
Contributing
While I've tried to imagine the sorts of odd situations that could cause errors and test/correct them to match the real server's behaviour, I will surely have missed something. If you find something behaving wrongly please do raise an issue or pull request!
Also, if you have any idea how to write proper tests, that would be grand.
Thank you.
Release files for vintagestory-masterserver 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vintagestory_masterserver-1.0.3.tar.gz | 45.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vintagestory_masterserver-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 80.2 kB
Release files / vintagestory_masterserver-1.0.3.tar.gz
| Download URL | vintagestory_masterserver-1.0.3.tar.gz |
|---|---|
| Size | 45.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80998f85a18003773390a44e68ff630d5d055e34a17777180ba7568f9ba68752
|
|
BLAKE2b-256 checksum How to use checksums |
00648d621f66eb2799fa90c7691999af01d7b2937fb02b89264f36a8133c04e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|
Release files / vintagestory_masterserver-1.0.3-py3-none-any.whl
| Download URL | vintagestory_masterserver-1.0.3-py3-none-any.whl |
|---|---|
| Size | 34.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cdc2bcc1ba1890726988dc98eff8b14c7c7ca287f44b5ec72d82eb764450937c
|
|
BLAKE2b-256 checksum How to use checksums |
2e339a7b10a28fffda9396199bc08e131bd4023c356085d048812cda0c4147a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.0
|