namespace axXez.TS3.Protocol
{
/// Instance-level configuration returned by instanceinfo: flood protection thresholds, file transfer port, and template group IDs.
public class InstanceInfo : TsEntity
{
/// Version number of the server instance's database schema.
[TsField("serverinstance_database_version")]
public int DatabaseVersion { get; protected set; }
/// TCP port used for file transfers on this instance.
[TsField("serverinstance_filetransfer_port")]
public int FileTransferPort { get; protected set; }
/// Maximum total download bandwidth in bytes per second; 18446744073709551615 means unlimited.
[TsField("serverinstance_max_download_total_bandwidth")]
public ulong MaxDownloadBandwidth { get; protected set; }
/// Maximum total upload bandwidth in bytes per second; 18446744073709551615 means unlimited.
[TsField("serverinstance_max_upload_total_bandwidth")]
public ulong MaxUploadBandwidth { get; protected set; }
/// ID of the server group assigned to guest query clients by default.
[TsField("serverinstance_guest_serverquery_group")]
public int DefaultServerQueryGroupID { get; protected set; }
/// Number of commands a query client may send within seconds before being flood-blocked.
[TsField("serverinstance_serverquery_flood_commands")]
public int QueryFloodCommandThreshold { get; protected set; }
/// Time window in seconds over which query flood commands are counted; 0 disables flood protection.
[TsField("serverinstance_serverquery_flood_time")]
public int QueryFloodResetInterval { get; protected set; }
/// Duration in seconds a query client is banned after triggering flood protection.
[TsField("serverinstance_serverquery_ban_time")]
public int QueryFloodBanTime { get; protected set; }
/// ID of the server group used as the admin template when creating new virtual servers.
[TsField("serverinstance_template_serveradmin_group")]
public int TemplateAdminGroupID { get; protected set; }
/// ID of the server group used as the default template when creating new virtual servers.
[TsField("serverinstance_template_serverdefault_group")]
public int TemplateDefaultGroupID { get; protected set; }
/// ID of the channel group used as the channel admin template when creating new virtual servers.
[TsField("serverinstance_template_channeladmin_group")]
public int TemplateChannelAdminGroupID { get; protected set; }
/// ID of the channel group used as the channel default template when creating new virtual servers.
[TsField("serverinstance_template_channeldefault_group")]
public int TemplateChannelDefaultGroupID { get; protected set; }
/// Version number of the permissions system used by this instance.
[TsField("serverinstance_permissions_version")]
public int PermissionsVersion { get; protected set; }
/// Maximum number of pending connections allowed per IP address; 0 means unlimited.
[TsField("serverinstance_pending_connections_per_ip")]
public int PendingConnectionsPerIP { get; protected set; }
/// Maximum number of concurrent query connections allowed per IP address.
[TsField("serverinstance_serverquery_max_connections_per_ip")]
public int MaxServerQueryConnectionsPerIP { get; protected set; }
/// Whether query flood protection is currently active.
public bool IsQueryFloodProtectionEnabled => QueryFloodResetInterval > 0 && QueryFloodCommandThreshold > 0;
internal InstanceInfo(TsDataEntry data) : base(data) { }
}
}