Skip to main content

CommandLineArguments

A static class in Alta.CommandLine, the global namespace.

Static access to the game's command line. Matching is case-insensitive, and the constants name the flags the game reads.

Fields​

MemberWhat it is
const string AccessTokenArgument/access_token: login access token passed by the launcher. Also marks the launch source as Launcher.
const string AgonesArgument/agones: marks an Agones-hosted server. Skips the launch analytics event.
const string AppDataPathArgument/app_data_path: base folder for game data instead of the default A Township Tale folder in AppData.
const string AutocamArgument/autocam flag name. Not read anywhere in this build.
const string BatchmodeArgumentUnity's -batchmode. Makes ApplicationManager.IsHeadless true.
const string ConsoleArgument/console: opens the in-game console on start for users with debug_features.
const string CustomEndpointArgument/custom_api: use the next argument as the web API URL.
const string DatabaseSettingsArgument/db_settings: server loads its config by server id instead of from the save folder.
const string DevelopmentApiEndpointArgument/development_api: use the development web API.
const string FlyArgument/fly: run without VR.
const string ForceOfflineMode/force_offline: always start the offline API client.
const string HeadlessServerLogFileNameSuffix of the headless server's log file name.
const string HeartbeatArgument/heartbeat: server sends heartbeats.
const string HostingPlatform/hosting_platform flag name. Not read anywhere in this build.
const string IdentityTokenArgument/identity_token: login identity token passed by the launcher.
const string IgnoreOfflineMode/ignore_offline: don't fall back to offline mode when there's no internet.
const string JoinServerArgument/join_server: join the server with the next argument as its id after login.
const string LatestApiEndpointArgument/latest_api: use the latest web API stage.
const string LaunchSourceArgument/source: launch source sent with the GameLaunch analytics event.
const string ListenToApiArgument/listen_to_api flag name. Not read anywhere in this build.
const string LocalApiEndpointArgument/local_api: use a web API on localhost:13490.
const string LogFileArgumentUnity's -logFile, read when setting up logging.
const string LoggingConfigPathArgument/logging_config_path: path to the NLog config file to use.
const string LoginArgument/login: log in with the next two arguments.
const string LoginWithHashArgument/login_hash: log in with a username and password hash.
const string ModsPathArgument/mods_path: folder to load mod scripts from.
const string NoGraphicsArgumentUnity's -nographics. Makes ApplicationManager.IsHeadless true.
const string OauthLoginArgument/oauth_login: OAuth login with the next three arguments.
const string RefreshTokenArgument/refresh_token: login refresh token passed by the launcher.
const string RemoteConsoleArgument/remote_console flag name. Not read anywhere in this build.
const string RemoteSavesArgument/remote_saves: store saves remotely (type gcs or s3, then the location).
const string S3CredentialsArgument/s3_credentials: access and secret key for S3 remote saves.
const string SkipTestsArgument/skip-tests flag name. Not read anywhere in this build.
const string SpotInstanceArgument/spot_instance flag name. Not read anywhere in this build.
const string StartServerArgument/start_server: start a server with id, headless flag and port.
const string TestApiEndpointArgument/test_api: use the test web API stage.
const string VersionArgument/version flag name. Not read anywhere in this build.
const string VivoxSandboxArgument/vivox_sandbox: use the Vivox sandbox for voice.
const string VrModeKey-vrmode: picks the XR mode from the next argument.
const string VrModeKeyAlt/vrmode: same as -vrmode.
const string WipeArgument/wipe: server wipes its world once it has started.
4 private and internal fields
MemberWhat it is
private static List<string> argumentsBacking field for AllArguments.
private static readonly Logger loggerNLog logger for this class.
private static Dictionary<string, string> originalArgumentsMap from lowercased argument to its original text.
private static string rawCommandLineBacking field for RawCommandLine.

Properties​

MemberWhat it is
static List<string> AllArguments { get; }All arguments, lowercased. Null until something has called Contains or TryGetNextArguments.
static string RawCommandLine { get; }The full command line with the executable path removed. Cached after first use.

Methods​

MemberWhat it is
static bool Contains(string argument)True if the given flag is on the command line, ignoring case.
static bool TryGetNextArguments(string argument, int numberOfArgumentsExpected, out string[] nextArguments, bool isOptionalArgs = false)Gets the given number of arguments after a flag, with their original case. Returns isOptionalArgs if there aren't enough.
2 private and internal methods
MemberWhat it is
private static void CheckInitialized()Reads the command line on first use, storing lowercased arguments and a map back to the original text.
private static IEnumerable<string> ParseArguments(string commandLine)Splits a command line string on spaces outside quotes and strips the quotes. Not called in this file.