Class JoinCodeDefaults

Namespace
Unity.Multiplayer.Core

The default-provider rule, engine-free so dotnet test covers it.

public static class JoinCodeDefaults
Inheritance
JoinCodeDefaults
Inherited Members

Methods

ForHosting(JoinCodeProvider, bool, bool)

The one provider a listen server publishes with when it can only use one (HostingOrder(JoinCodeProvider, bool, bool)'s first). When nothing is set up it is the configured provider (Relay for Auto), so the caller reports what is missing.

public static JoinCodeProvider ForHosting(JoinCodeProvider configured, bool relayAvailable, bool hasRendezvousUrl)

Parameters

configured JoinCodeProvider
relayAvailable bool
hasRendezvousUrl bool

Returns

JoinCodeProvider

ForPublishing(Topology, JoinCodeProvider)

The provider a Host or Server publishes its code with. Auto becomes Relay for a Host and Rendezvous for a Server; an explicit choice is kept. A Client publishes nothing (None).

public static JoinCodeProvider ForPublishing(Topology topology, JoinCodeProvider configured)

Parameters

topology Topology
configured JoinCodeProvider

Returns

JoinCodeProvider

HostingOrder(JoinCodeProvider, bool, bool)

The providers a listen server (Host) tries, in order, to publish a join code (UM-T63). An explicit choice is kept when it can work (Relay installed, a rendezvous URL set). Auto is Relay first when it is installed (it gets through NAT), then the rendezvous service when a URL is configured, so a game with only a rendezvous URL still gets a code. Empty when nothing can publish one (codes off, or nothing set up).

public static IReadOnlyList<JoinCodeProvider> HostingOrder(JoinCodeProvider configured, bool relayAvailable, bool hasRendezvousUrl)

Parameters

configured JoinCodeProvider

The configured provider (JoinCodes).

relayAvailable bool

Whether Unity Relay is installed (com.unity.services.multiplayer).

hasRendezvousUrl bool

Whether RendezvousUrl is set.

Returns

IReadOnlyList<JoinCodeProvider>

ShouldSelfRegister(NetConfig)

Whether a dedicated server should register itself with the rendezvous service as soon as it is running: it is a Server, its provider is (or defaults to) Rendezvous, and a rendezvous URL is configured.

public static bool ShouldSelfRegister(NetConfig config)

Parameters

config NetConfig

Returns

bool