Class NetLaunch

Namespace
Unity.Multiplayer.Core

Decides whether a process starts a session by itself at launch, and as what. The rule NetBootstrap follows, kept engine-free so it is tested by plain dotnet test.

public static class NetLaunch
Inheritance
NetLaunch
Inherited Members

Remarks

  1. A bot (-bot <role>) never starts by itself: the bot runner joins once it has a join code.
  2. A -mode on the command line always wins: the process starts as that topology.
  3. Otherwise a headless process (batch mode, -nographics, a Dedicated Server build) with serveWhenHeadless set starts as a dedicated Server.
  4. Otherwise it starts only when autoStart is set, as the configured topology.

Methods

ShouldStart(NetConfig, NetCommandLineResult, bool, bool, bool)

Applies the rule above. Returns true when the session should start now; may set config's topology to Server (rule 2).

public static bool ShouldStart(NetConfig config, NetCommandLineResult commandLine, bool headless, bool autoStart, bool serveWhenHeadless)

Parameters

config NetConfig
commandLine NetCommandLineResult
headless bool
autoStart bool
serveWhenHeadless bool

Returns

bool

Exceptions

ArgumentNullException

config or commandLine is null.

ShowsMenus(NetCommandLineResult, bool)

True when a player-facing front end (menus, dialogs) may be created: never in a headless process (a dedicated server, a CI run), and never when -mode or -bot launched the process into a role by itself (a server, or a bot client), since nobody is there to click.

public static bool ShowsMenus(NetCommandLineResult commandLine, bool headless)

Parameters

commandLine NetCommandLineResult
headless bool

Returns

bool

Exceptions

ArgumentNullException

commandLine is null.