mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-12 16:28:27 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
51 lines
1.3 KiB
C#
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.
|
|
}
|