Skip to main content

ServerListingPayload

A struct in TavernLib, TavernLib.Backend.Server.

The JSON body each heartbeat sends to the Community Servers listing, built from the server's settings and ports.

Properties​

MemberWhat it is
bool CommunityListed { get; private set; }community_listed from the server settings.
bool HasPassword { get; private set; }True when the settings have a password hash.
string HostName { get; private set; }public_hostname from the server settings.
string ListingToken { get; private set; }The server's community_listing_token, which identifies it to the listing.
string Name { get; private set; }The server's name.
int PlayerCount { get; private set; }ServerHandler.Current.Connections, or 0 before the server is up.
int PlayerLimit { get; private set; }The live ServerHandler.PlayerLimit, or the settings' limit before the server is up.
int Port { get; private set; }server_port from tavern_server.json, as written (0 if left out).
bool Quest { get; private set; }True when the server runs the Quest scene: /questScene, or quest_scene in the settings.
string Region { get; private set; }region from the server settings.
bool Tutorial { get; private set; }True when the server runs the tutorial scene: /tutorialScene, or tutorial_scene. Beats Quest.
string Version { get; private set; }TavernLib's version.

Methods​

MemberWhat it is
static ServerListingPayload FromConfig(ServerSettingsConfig config, TavernServerConfig tavernConfig)Builds the payload from the last-read settings and ports, using the live player limit and connection count when a server is running.
1 private and internal method
MemberWhat it is
private static ServerListingPayload.SceneKind ResolveScene(ServerSettingsConfig config)Decides whether the server runs the normal, quest or tutorial scene, with the launch arguments first and the settings as fallback.