using System; namespace axXez.TS3.Protocol { /// Full virtual server configuration and stats returned by serverinfo. public class ServerInfo : TsEntity, IVirtualServer, IPlatformVersion { /// Virtual server ID. [TsField("virtualserver_id")] public int ID { get; protected set; } /// Unique identifier of the virtual server. [TsField("virtualserver_unique_identifier")] public string UID { get; protected set; } /// Display name of the virtual server. [TsField("virtualserver_name")] public string Name { get; protected set; } /// Phonetic pronunciation of the server name, used by text-to-speech. [TsField("virtualserver_name_phonetic")] public string PhoneticName { get; protected set; } /// Message shown to clients when they connect to the server. [TsField("virtualserver_welcomemessage")] public string WelcomeMessage { get; protected set; } /// Operating system platform the server is running on. [TsField("virtualserver_platform")] public string Platform { get; protected set; } /// Server application version string including build number. [TsField("virtualserver_version")] public string Version { get; protected set; } /// Maximum number of clients allowed on the server simultaneously. [TsField("virtualserver_maxclients")] public int MaxClients { get; protected set; } /// Hashed server password; empty if no password is set. [TsField("virtualserver_password")] public string PasswordHash { get; protected set; } /// Number of regular voice clients currently connected. [TsField("virtualserver_clientsonline")] public int ClientsOnline { get; protected set; } /// Number of query clients currently connected. [TsField("virtualserver_queryclientsonline")] public int CurrentQueryClientConnections { get; protected set; } /// Number of channels currently existing on the server. [TsField("virtualserver_channelsonline")] public int ChannelsOnline { get; protected set; } /// Date and time the virtual server was created. [TsField("virtualserver_created")] public DateTime Created { get; protected set; } /// Time the virtual server has been running since last start, in seconds. [TsField("virtualserver_uptime")] public int UptimeSeconds { get; protected set; } /// Time the virtual server has been running since last start. public TimeSpan Uptime => TimeSpan.FromSeconds(UptimeSeconds); /// UDP port the virtual server listens on for voice connections. [TsField("virtualserver_port")] public int Port { get; protected set; } /// Whether the server starts automatically when the server process starts. [TsField("virtualserver_autostart")] public bool Autostart { get; protected set; } /// Current status of the virtual server (e.g. "online"). [TsField("virtualserver_status")] public string Status { get; protected set; } /// Whether the server is password protected. [TsField("virtualserver_flag_password")] public bool PasswordEnabled { get; protected set; } /// Server-wide voice encryption policy. [TsField("virtualserver_codec_encryption_mode")] public CodecEncryptionMode CodecEncryptionMode { get; protected set; } /// How the host message is presented to clients on connect. [TsField("virtualserver_hostmessage_mode")] public HostMessageMode HostMessageMode { get; protected set; } /// Host message text displayed to clients according to . [TsField("virtualserver_hostmessage")] public string HostMessage { get; protected set; } /// Base directory path used for file storage on this virtual server. [TsField("virtualserver_filebase")] public string FileBase { get; protected set; } /// ID of the server group automatically assigned to new clients. [TsField("virtualserver_default_server_group")] public int DefaultServerGroupID { get; protected set; } /// ID of the channel group automatically assigned to clients in channels. [TsField("virtualserver_default_channel_group")] public int DefaultChannelGroupID { get; protected set; } /// ID of the channel group granted to clients who create a channel. [TsField("virtualserver_default_channel_admin_group")] public int DefaultAdminChannelGroupID { get; protected set; } /// Maximum total download bandwidth in bytes per second; 18446744073709551615 means unlimited. [TsField("virtualserver_max_download_total_bandwidth")] public ulong MaxTotalDownloadBandwidth { get; protected set; } /// Maximum total upload bandwidth in bytes per second; 18446744073709551615 means unlimited. [TsField("virtualserver_max_upload_total_bandwidth")] public ulong MaxTotalUploadBandwidth { get; protected set; } /// Per-client download quota in bytes; 18446744073709551615 means unlimited. [TsField("virtualserver_download_quota")] public ulong DownloadQuota { get; protected set; } /// Per-client upload quota in bytes; 18446744073709551615 means unlimited. [TsField("virtualserver_upload_quota")] public ulong UploadQuota { get; protected set; } /// URL the hostbanner links to when clicked. [TsField("virtualserver_hostbanner_url")] public string HostbannerUrl { get; protected set; } /// URL of the hostbanner image. [TsField("virtualserver_hostbanner_gfx_url")] public string HostbannerGFXUrl { get; protected set; } /// Interval in seconds at which the hostbanner image is refreshed. [TsField("virtualserver_hostbanner_gfx_interval")] public int HostbannerGFXInterval { get; protected set; } /// How the hostbanner image is scaled in the client. [TsField("virtualserver_hostbanner_mode")] public BannerMode HostbannerMode { get; protected set; } /// URL the hostbutton links to when clicked. [TsField("virtualserver_hostbutton_url")] public string HostbuttonUrl { get; protected set; } /// URL of the hostbutton image. [TsField("virtualserver_hostbutton_gfx_url")] public string HostbuttonGFXUrl { get; protected set; } /// Tooltip text shown when hovering over the hostbutton. [TsField("virtualserver_hostbutton_tooltip")] public string HostbuttonTooltip { get; protected set; } /// Number of complaints a client must receive before being automatically banned. [TsField("virtualserver_complain_autoban_count")] public int ComplainAutoBanCount { get; protected set; } /// Duration in seconds of the auto-ban triggered by too many complaints. [TsField("virtualserver_complain_autoban_time")] public int ComplainAutoBanTime { get; protected set; } /// Time in seconds after which resolved complaints are removed. [TsField("virtualserver_complain_remove_time")] public int ComplainRemoveTime { get; protected set; } /// Minimum number of clients in a channel before non-talkers are force-silenced. [TsField("virtualserver_min_clients_in_channel_before_forced_silence")] public int MinClientsForForcedSilence { get; protected set; } /// Volume modifier (in dB) applied to non-priority speakers when a priority speaker is active. [TsField("virtualserver_priority_speaker_dimm_modificator")] public float PrioritySpeakerDimmModifyer { get; protected set; } /// Anti-flood points reduced per server tick for each client. [TsField("virtualserver_antiflood_points_tick_reduce")] public int AntiFloodTickPointReduce { get; protected set; } /// Anti-flood point threshold at which command execution is blocked. [TsField("virtualserver_antiflood_points_needed_command_block")] public int AntiFloodCommandBlockThreshold { get; protected set; } /// Anti-flood point threshold at which the client's IP is blocked. [TsField("virtualserver_antiflood_points_needed_ip_block")] public int AntiFloodIPBlockThreshold { get; protected set; } /// Anti-flood point threshold at which plugin commands are blocked. [TsField("virtualserver_antiflood_points_needed_plugin_block")] public int AntiFloodPluginBlockThreshold { get; protected set; } /// Total number of regular client connections since the server was created. [TsField("virtualserver_client_connections")] public int TotalClientConnections { get; protected set; } /// Total number of query client connections since the server was created. [TsField("virtualserver_query_client_connections")] public int TotalQueryClientConnections { get; protected set; } /// Total bytes downloaded from this server during the current calendar month. [TsField("virtualserver_month_bytes_downloaded")] public long BytesDownloadedLastMonth { get; protected set; } /// Total bytes uploaded to this server during the current calendar month. [TsField("virtualserver_month_bytes_uploaded")] public long BytesUploadedLastMonth { get; protected set; } /// Total bytes downloaded from this server across all time. [TsField("virtualserver_total_bytes_downloaded")] public long TotalBytesDownloaded { get; protected set; } /// Total bytes uploaded to this server across all time. [TsField("virtualserver_total_bytes_uploaded")] public long TotalBytesUploaded { get; protected set; } /// Minimum identity security level required to connect to this server. [TsField("virtualserver_needed_identity_security_level")] public int NeededIdentitySecurityLevel { get; protected set; } /// Whether client connect/disconnect events are written to the server log. [TsField("virtualserver_log_client")] public bool LogClient { get; protected set; } /// Whether query client events are written to the server log. [TsField("virtualserver_log_query")] public bool LogQuery { get; protected set; } /// Whether channel create/edit/delete events are written to the server log. [TsField("virtualserver_log_channel")] public bool LogChannel { get; protected set; } /// Whether permission change events are written to the server log. [TsField("virtualserver_log_permissions")] public bool LogPermissions { get; protected set; } /// Whether server start/stop events are written to the server log. [TsField("virtualserver_log_server")] public bool LogServer { get; protected set; } /// Whether file transfer events are written to the server log. [TsField("virtualserver_log_filetransfer")] public bool LogFiletransfer { get; protected set; } /// Minimum client build timestamp required to connect; clients older than this are rejected. [TsField("virtualserver_min_client_version")] public string MinClientVersion { get; protected set; } /// Minimum Android client build timestamp required to connect. [TsField("virtualserver_min_android_version")] public string MinAndroidVersion { get; protected set; } /// Minimum iOS client build timestamp required to connect. [TsField("virtualserver_min_ios_version")] public string MinIOsVersion { get; protected set; } /// Icon ID displayed next to the server name in the client. [TsField("virtualserver_icon_id")] public int IconID { get; protected set; } /// Number of client slots reserved and not available to regular clients. [TsField("virtualserver_reserved_slots")] public int ReservedSlots { get; protected set; } /// Average packet loss ratio for voice (speech) traffic. [TsField("virtualserver_total_packetloss_speech")] public float TotalPacketlossSpeech { get; protected set; } /// Average packet loss ratio for keepalive traffic. [TsField("virtualserver_total_packetloss_keepalive")] public float TotalPacketlossKeepalive { get; protected set; } /// Average packet loss ratio for control traffic. [TsField("virtualserver_total_packetloss_control")] public float TotalPacketlossControl { get; protected set; } /// Average packet loss ratio across all traffic types combined. [TsField("virtualserver_total_packetloss_total")] public float TotalPacketlossTotal { get; protected set; } /// Average ping of all currently connected clients in milliseconds. [TsField("virtualserver_total_ping")] public float Ping { get; protected set; } /// IP address(es) the server is bound to; multiple addresses separated by commas. [TsField("virtualserver_ip")] public string IP { get; protected set; } /// Whether this server is listed on the public TeamSpeak server list. [TsField("virtualserver_weblist_enabled")] public bool WeblistEnabled { get; protected set; } /// Whether clients are prompted to enter a privilege key when connecting. [TsField("virtualserver_ask_for_privilegekey")] public bool AskForPrivilageKey { get; protected set; } /// Default delay in seconds before a temporary channel is deleted after the last client leaves. [TsField("virtualserver_channel_temp_delete_delay_default")] public int DefaultTempChannelDeleteDelay { get; protected set; } /// Machine ID used to identify the physical host when multiple servers share an instance. [TsField("virtualserver_machine_id")] public int MachineID { get; protected set; } /// Nickname assigned to the server's own query client identity. [TsField("virtualserver_nickname")] public string Nickname { get; protected set; } /// Capability extensions advertised by the server. [TsField("virtualserver_capability_extensions")] public string CapabilityExtensions { get; protected set; } /// File storage class identifier used for this virtual server's file system backend. [TsField("virtualserver_file_storage_class")] public string FileStorageClass { get; protected set; } // --- Connection stats --- /// Current file transfer upload bandwidth in bytes/s. [TsField("connection_filetransfer_bandwidth_sent")] public int CurrentOutgoingFileTransferBandwidth { get; protected set; } /// Current file transfer download bandwidth in bytes/s. [TsField("connection_filetransfer_bandwidth_received")] public int CurrentIncomingFileTransferBandwidth { get; protected set; } /// Total bytes sent via file transfer across all time. [TsField("connection_filetransfer_bytes_sent_total")] public long TotalFileTransferBytesSent { get; protected set; } /// Total bytes received via file transfer across all time. [TsField("connection_filetransfer_bytes_received_total")] public long TotalFileTransferBytesReceived { get; protected set; } /// Total UDP packets sent by the server across all traffic types. [TsField("connection_packets_sent_total")] public long PacketsSent { get; protected set; } /// Total UDP packets received by the server across all traffic types. [TsField("connection_packets_received_total")] public long PacketsReceived { get; protected set; } /// Total bytes sent by the server across all traffic types. [TsField("connection_bytes_sent_total")] public long BytesSent { get; protected set; } /// Total bytes received by the server across all traffic types. [TsField("connection_bytes_received_total")] public long BytesReceived { get; protected set; } /// Average outgoing bandwidth over the last second in bytes/s. [TsField("connection_bandwidth_sent_last_second_total")] public int LastSecondAvgOutgoingBandwidth { get; protected set; } /// Average outgoing bandwidth over the last minute in bytes/s. [TsField("connection_bandwidth_sent_last_minute_total")] public int LastMinuteAvgOutgoingBandwidth { get; protected set; } /// Average incoming bandwidth over the last second in bytes/s. [TsField("connection_bandwidth_received_last_second_total")] public int LastSecondAvgIncomingBandwidth { get; protected set; } /// Average incoming bandwidth over the last minute in bytes/s. [TsField("connection_bandwidth_received_last_minute_total")] public int LastMinuteAvgIncomingBandwidth { get; protected set; } /// Total voice (speech) packets sent by the server. [TsField("connection_packets_sent_speech")] public long SpeechPacketsSent { get; protected set; } /// Total voice (speech) bytes sent by the server. [TsField("connection_bytes_sent_speech")] public long SpeechBytesSent { get; protected set; } /// Total voice (speech) packets received by the server. [TsField("connection_packets_received_speech")] public long SpeechPacketsReceived { get; protected set; } /// Total voice (speech) bytes received by the server. [TsField("connection_bytes_received_speech")] public long SpeechBytesReceived { get; protected set; } /// Total keep-alive packets sent by the server. [TsField("connection_packets_sent_keepalive")] public long KeepAlivePacketsSent { get; protected set; } /// Total keep-alive bytes sent by the server. [TsField("connection_bytes_sent_keepalive")] public long KeepAliveBytesSent { get; protected set; } /// Total keep-alive packets received by the server. [TsField("connection_packets_received_keepalive")] public long KeepAlivePacketsReceived { get; protected set; } /// Total keep-alive bytes received by the server. [TsField("connection_bytes_received_keepalive")] public long KeepAliveBytesReceived { get; protected set; } /// Total control packets sent by the server. [TsField("connection_packets_sent_control")] public long ControlPacketsSent { get; protected set; } /// Total control bytes sent by the server. [TsField("connection_bytes_sent_control")] public long ControlBytesSent { get; protected set; } /// Total control packets received by the server. [TsField("connection_packets_received_control")] public long ControlPacketsReceived { get; protected set; } /// Total control bytes received by the server. [TsField("connection_bytes_received_control")] public long ControlBytesReceived { get; protected set; } internal ServerInfo(TsDataEntry data) : base(data) { } } }