Class BotCommandLine

Namespace
Unity.Multiplayer.Core

Reads the bot and end-to-end arguments from a process command line (UM-T57). Engine-free, so the rules are tested by plain dotnet test; the adapter's NetBots acts on them at launch.

public static class BotCommandLine
Inheritance
BotCommandLine
Inherited Members

Remarks

-bot <role>This process is a bot client playing role (any word the game's driver understands: A, B, runner, ...). It starts no session by itself, shows no menus, joins, then hands the session to the game's IBotDriver.
-joincode <code>Bot: the join code to join by.
-joincodefile <path>Bot: wait for this file and join by the code in it. Server: write every join code it publishes to this file (atomically), so bots started beside it can read it (a shared Docker volume, a temp folder in a test).
-scenario <name>Free text the game reads to set the run up (a level, a map, a mode); the library only passes it on. Server and bots alike.
-bottimeout <seconds>Bot: fail the run after this long (default DefaultTimeoutSeconds).

Names ignore case and take their value as the next argument or after =. Anything else is ignored.

Fields

BotArg

Makes this process a bot client playing the given role.

public const string BotArg = "-bot"

Field Value

string

DefaultTimeoutSeconds

The default for TimeoutArg, in seconds.

public const double DefaultTimeoutSeconds = 180

Field Value

double

JoinCodeArg

The join code a bot joins by.

public const string JoinCodeArg = "-joincode"

Field Value

string

JoinCodeFileArg

The file a bot reads the join code from, and a server writes it to.

public const string JoinCodeFileArg = "-joincodefile"

Field Value

string

ScenarioArg

The scenario the game sets the run up for.

public const string ScenarioArg = "-scenario"

Field Value

string

TimeoutArg

Seconds a bot's whole run may take.

public const string TimeoutArg = "-bottimeout"

Field Value

string

Methods

Parse(IReadOnlyList<string>)

Reads the bot arguments in args (a later repeat wins).

public static BotLaunchOptions Parse(IReadOnlyList<string> args)

Parameters

args IReadOnlyList<string>

Returns

BotLaunchOptions

Exceptions

ArgumentNullException

args is null.