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
- A bot (
-bot <role>) never starts by itself: the bot runner joins once it has a join code. - A
-modeon the command line always wins: the process starts as that topology. - Otherwise a headless process (batch mode,
-nographics, a Dedicated Server build) withserveWhenHeadlessset starts as a dedicated Server. - Otherwise it starts only when
autoStartis 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
configNetConfigcommandLineNetCommandLineResultheadlessboolautoStartboolserveWhenHeadlessbool
Returns
Exceptions
- ArgumentNullException
configorcommandLineis 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
commandLineNetCommandLineResultheadlessbool
Returns
Exceptions
- ArgumentNullException
commandLineis null.