Class GenericVpsProfile

Namespace
Unity.Multiplayer.Core

The default hosting profile: the package as a Docker image, run beside the rendezvous service with Docker Compose on any UDP-capable CPU VPS (Hetzner, Vultr, DigitalOcean and similar). Players connect over UDP and join by code.

public sealed class GenericVpsProfile : IHostingProfile
Inheritance
GenericVpsProfile
Implements
Inherited Members

Remarks

Adds a Dockerfile, a .dockerignore, docker-compose.yml (the game server plus the rendezvous service, saves and logs in named volumes, the health port bound to localhost) and HOSTING.txt (the steps, and the firewall ports to open).

Fields

ComposeFileName

The compose file's name.

public const string ComposeFileName = "docker-compose.yml"

Field Value

string

NotesFileName

The notes file's name.

public const string NotesFileName = "HOSTING.txt"

Field Value

string

ProfileId

This profile's Id.

public const string ProfileId = "GenericVps"

Field Value

string

RendezvousPort

The rendezvous service's port in the compose file (its image's default).

public const ushort RendezvousPort = 8080

Field Value

ushort

Properties

BaseImage

The Docker base image; null for DefaultBaseImage.

public string BaseImage { get; set; }

Property Value

string

Description

One sentence: what host this suits.

public string Description { get; }

Property Value

string

DisplayName

A name for people (Generic VPS (Docker)).

public string DisplayName { get; }

Property Value

string

Id

A short, file-safe identifier (GenericVps), used in menus, the manifest and folder names.

public string Id { get; }

Property Value

string

Methods

ComposeCompose(ServerPackageSpec)

The docker-compose.yml text.

public static string ComposeCompose(ServerPackageSpec spec)

Parameters

spec ServerPackageSpec

Returns

string

ComposeNotes(ServerPackageSpec)

The HOSTING.txt text.

public static string ComposeNotes(ServerPackageSpec spec)

Parameters

spec ServerPackageSpec

Returns

string

Configure(ServerPackageSpec)

Adjusts the package's settings for this host before anything is written, such as forcing WebSocket. Called once by For(IHostingProfile, string, NetConfig, ServerSettings).

public void Configure(ServerPackageSpec spec)

Parameters

spec ServerPackageSpec

CreateFiles(ServerPackageSpec)

The profile's own files, added to the package after the common ones. None may share a path with them.

public IReadOnlyList<ServerPackageFile> CreateFiles(ServerPackageSpec spec)

Parameters

spec ServerPackageSpec

Returns

IReadOnlyList<ServerPackageFile>