Class NetEnvironment

Namespace
Unity.Multiplayer.Core

Reads join-code settings from environment variables onto a NetConfig: how a container or a hosting provider hands a dedicated server its rendezvous URL and secret without putting the secret on a command line other processes can read. Applied before the command line, so an argument still wins.

public static class NetEnvironment
Inheritance
NetEnvironment
Inherited Members

Remarks

MINDATTIC_RENDEZVOUS_URLRendezvousUrl.
MINDATTIC_RENDEZVOUS_SECRETRendezvousSecret.
MINDATTIC_PUBLIC_ADDRESSPublicAddress.
MINDATTIC_SERVER_PASSWORDPassword.

Unset or empty variables change nothing. RunPod's own RUNPOD_PUBLIC_IP and RUNPOD_TCP_PORT_* are read later, by For(NetConfig, Func<string, string>).

Fields

PublicAddressVariable

Environment variable for PublicAddress.

public const string PublicAddressVariable = "MINDATTIC_PUBLIC_ADDRESS"

Field Value

string

RendezvousSecretVariable

Environment variable for RendezvousSecret.

public const string RendezvousSecretVariable = "MINDATTIC_RENDEZVOUS_SECRET"

Field Value

string

RendezvousUrlVariable

Environment variable for RendezvousUrl.

public const string RendezvousUrlVariable = "MINDATTIC_RENDEZVOUS_URL"

Field Value

string

ServerPasswordVariable

Environment variable for Password.

public const string ServerPasswordVariable = "MINDATTIC_SERVER_PASSWORD"

Field Value

string

Methods

Apply(NetConfig, Func<string, string>)

Applies every set variable to config.

public static void Apply(NetConfig config, Func<string, string> environment = null)

Parameters

config NetConfig

The config to fill.

environment Func<string, string>

Reads a variable (null when unset); null reads the process environment.

Exceptions

ArgumentNullException

config is null.