Files
sbox-public/engine/Sandbox.Engine/Game/LaunchArguments.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

51 lines
1.3 KiB
C#

using Sandbox.Network;
namespace Sandbox;
/// <summary>
/// These are arguments that were set when launching the current game.
/// This is used to pre-configure the game from the menu
/// </summary>
public static class LaunchArguments
{
/// <summary>
/// The map to start with. It's really up to the game to use this
/// </summary>
public static string Map { get; set; }
/// <summary>
/// Preferred max players for multiplayer games. Used by games, but not enforced.
/// </summary>
public static int MaxPlayers { get; set; }
/// <summary>
/// Default privacy for lobbies created on game start.
/// </summary>
public static LobbyPrivacy Privacy { get; set; } = LobbyPrivacy.Public;
/// <summary>
/// The game settings to apply on join. These are a list of convars.
/// </summary>
public static Dictionary<string, string> GameSettings { get; set; }
/// <summary>
/// The hostname for the server.
/// </summary>
public static string ServerName { get; set; }
/// <summary>
/// Should be called when leaving a game to set the properties back to default. We need to be
/// aware and prevent these leaking between games.
/// </summary>
internal static void Reset()
{
GameSettings = default;
Map = default;
Privacy = default;
ServerName = default;
MaxPlayers = 1;
}
// TODO - save launch arguments and restore them, per game.
}