namespace Sandbox.Network; [Expose] public struct LobbyConfig { /// /// Whether to automatically destroy this lobby when the host leaves. This is only /// applicable to P2P lobbies. /// public bool DestroyWhenHostLeaves { get; set; } /// /// Whether to periodically switch to the best possible host candidate. This is only /// applicable to P2P lobbies. /// public bool AutoSwitchToBestHost { get; set; } /// /// Whether to hide this lobby from appearing in the server list. It will still be /// queryable programatically, so long as the mode allows it. /// public bool Hidden { get; set; } /// /// Determines who is able to connect to this lobby. This will be public by default. /// public LobbyPrivacy Privacy { get; set; } /// /// The maximum amount of players this lobby can hold. By default, this will be /// the Max Players set in the current Game Package's project settings. /// public int MaxPlayers { get; set; } /// /// The name of this lobby. If this isn't set, a default lobby name will be chosen instead. /// public string Name { get; set; } public LobbyConfig() { DestroyWhenHostLeaves = ProjectSettings.Networking.DestroyLobbyWhenHostLeaves; AutoSwitchToBestHost = ProjectSettings.Networking.AutoSwitchToBestHost; MaxPlayers = Application.GamePackage?.GetCachedMeta( "MaxPlayers", 32 ) ?? 32; } }