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