using System; using System.Collections.Generic; using UnityEngine.Scripting; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Unity.Services.Lobbies.Http; namespace Unity.Services.Lobbies.Models { /// /// The body of a Create Lobby request. /// The name of the lobby that should be displayed to users. All whitespace will be trimmed from name. /// The maximum number of players allowed in the lobby. /// Indicates whether or not the lobby is publicly visible and will show up in query results. If the lobby is not publicly visible, the creator can share the `lobbyCode` with other users who can use it to join this lobby. /// player param /// Custom game-specific properties that apply to the lobby (e.g. `mapName` or `gameType`). /// [Preserve] [DataContract(Name = "CreateRequest")] public class CreateRequest { /// /// The body of a Create Lobby request. /// /// The name of the lobby that should be displayed to users. All whitespace will be trimmed from name. /// The maximum number of players allowed in the lobby. /// Indicates whether or not the lobby is publicly visible and will show up in query results. If the lobby is not publicly visible, the creator can share the `lobbyCode` with other users who can use it to join this lobby. /// player param /// Custom game-specific properties that apply to the lobby (e.g. `mapName` or `gameType`). [Preserve] public CreateRequest(string name, int maxPlayers, bool? isPrivate = false, Player player = default, Dictionary data = default) { Name = name; MaxPlayers = maxPlayers; IsPrivate = isPrivate; Player = player; Data = data; } /// /// The name of the lobby that should be displayed to users. All whitespace will be trimmed from name. /// [Preserve] [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] public string Name{ get; } /// /// The maximum number of players allowed in the lobby. /// [Preserve] [DataMember(Name = "maxPlayers", IsRequired = true, EmitDefaultValue = true)] public int MaxPlayers{ get; } /// /// Indicates whether or not the lobby is publicly visible and will show up in query results. If the lobby is not publicly visible, the creator can share the `lobbyCode` with other users who can use it to join this lobby. /// [Preserve] [DataMember(Name = "isPrivate", EmitDefaultValue = true)] public bool? IsPrivate{ get; } [Preserve] [DataMember(Name = "player", EmitDefaultValue = false)] public Player Player{ get; } /// /// Custom game-specific properties that apply to the lobby (e.g. `mapName` or `gameType`). /// [Preserve] [DataMember(Name = "data", EmitDefaultValue = false)] public Dictionary Data{ get; } } }