LobbyServer/LobbyServerDto/LobbyCreate.cs

58 lines
2.1 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.Net;
namespace LobbyServerDto
{
/// <summary>
/// Create a lobby in the lobby list. The lobby will stay until either closed by the host or the host disconnects
/// </summary>
/// <remarks>A host can always have only one open lobby, if another lobby is already opened by the client it will be closed</remarks>
[LobbyMessage]
public partial class LobbyCreate
{
/// <summary>
/// Game Id for which game this lobby is for
/// </summary>
public Guid GameId { get; set; }
/// <summary>
/// Display name of the lobby
/// </summary>
[MaxLength(64)]
public string Name { get; set; } = string.Empty;
/// <summary>
/// Game mode of lobby
/// </summary>
public int GameMode { get; set; }
/// <summary>
/// How many players are in the lobby
/// </summary>
public int PlayerCount { get; set; }
/// <summary>
/// Maximum players allowed in the lobby
/// </summary>
public int MaxPlayerCount { get; set; }
/// <summary>
/// The hash of a password to protect the lobby. Only users with the password can request host information/nat punch.
/// </summary>
[MaxLength(64)]
public byte[]? PasswordHash { get; set; }
/// <summary>
/// The salt used to hash the password.
/// </summary>
[MaxLength(16)]
public byte[]? PasswordSalt { get; set; }
/// <summary>
/// The hosts ip addresses locally detected. Used the the host information send to clients on their request.
/// </summary>
[MaxLength(32)]
public IPAddress[]? HostIps { get; set; }
/// <summary>
/// The hosts port. Used the the host information send to clients on their request.
/// </summary>
public int HostPort { get; set; }
/// <summary>
/// The hosts echo port to try if a connection is possible.
/// </summary>
public int HostTryPort { get; set; }
}
}