Spksh/TentacleSoftware.TeamSpeakQuery

Response to serverinfo command returns new properties for TS 3.1.x, parsing breaks

Opened this issue · 13 comments

hi there :)

a question here, how can i get the serverVersion of the ts3 server? Can anyone give me an example?

Spksh commented

After you're connected, you want to call client.ServerInfo() and either await the task or access .Result. Read the VirtualServerVersion property on the ServerInfoResult object that is returned.

I highly recommend getting familiar with the data structures and commands available in the TS Server Query Manual (http://media.teamspeak.com/ts3_literature/TeamSpeak%203%20Server%20Query%20Manual.pdf).

I tried it like this but only get a false:

Dim server As ServerQueryBaseResult = Client.ServerInfo().Result
Console.WriteLine("VirtualServerVersion {0}", server.Success)
Spksh commented

Have a look at the TS3 Server Query Manual for the serverinfo command. You'll see:

Permissions: 
b_virtualserver_info_view 

Does your account have that permission?

Spksh commented

Additionally, to speed up your troubleshooting, inspect the values for the error/message properties on the result:

        [PropertyMapping("id", Required = true)]

        public int ErrorId { get; set; }



        [PropertyMapping("msg", Required = true)]

        public string ErrorMessage { get; set; }



        [PropertyMapping("extra_msg")]

        public string ExtraMessage { get; set; }



        [PropertyMapping("failed_permid")]

        public int FailedPermId { get; set; }

That'll give you more specific information to work with.

im in with the serveradmin(query), it should have all rights.

now i just get a true back...not the version

Spksh commented

Should have all the rights, but it's worth checking anyway.

Do other commands work as expected?

What values does the ServerInfoResult have for:

  • ErrorId
  • ErrorMessage
  • ExtraMessage
  • FailedPermId
  • Response

Yes if i use the response i get a huge string with serverinformations (name, welcometext, version etc.)

Dim server As ServerQueryBaseResult = Client.ServerInfo().Result
Console.WriteLine("VirtualServerVersion {0} {1} {2} {3}", server.Success, server.ErrorId, server.ErrorMessage, server.Response)

But the VirtualServerVersion shows me only a "true" ... there should be the versionnumber i guess?

Spksh commented

Ah, that will be a problem with parsing the response string; some property will be new/missing. Can you paste the full string here? Feel free to redact the sensitive stuff.

Ok 👍 This is it:

virtualserver_unique_identifier=0 virtualserver_name=ServerName virtualserver_welcomemessage=Herzlich\sWillkomen\sauf\sdem\sTS-Server\svon\s,\ssolltest\sdu\sProbleme\shaben,\swende\sdich\sbitte\san\sNG\sKirito\s/\sWolvwood\s/\sDaPhil\s(). virtualserver_platform=Windows virtualserver_version=3.1.1\s[Build:\s1519643644] virtualserver_maxclients=32 virtualserver_password virtualserver_clientsonline=3 virtualserver_channelsonline=26 virtualserver_created=1438173594 virtualserver_uptime=535237 virtualserver_codec_encryption_mode=2 virtualserver_hostmessage virtualserver_hostmessage_mode=0 virtualserver_filebase=files\virtualserver_2 virtualserver_default_server_group=11 virtualserver_default_channel_group=12 virtualserver_flag_password=0 virtualserver_default_channel_admin_group=9 virtualserver_max_download_total_bandwidth=18446744073709551615 virtualserver_max_upload_total_bandwidth=18446744073709551615 virtualserver_hostbanner_url virtualserver_hostbanner_gfx_url=https://www.pic.png virtualserver_hostbanner_gfx_interval=0 virtualserver_complain_autoban_count=5 virtualserver_complain_autoban_time=1200 virtualserver_complain_remove_time=3600 virtualserver_min_clients_in_channel_before_forced_silence=100 virtualserver_priority_speaker_dimm_modificator=-18.0000 virtualserver_id=2 virtualserver_antiflood_points_tick_reduce=5 virtualserver_antiflood_points_needed_command_block=150 virtualserver_antiflood_points_needed_ip_block=250 virtualserver_client_connections=80 virtualserver_query_client_connections=34 virtualserver_hostbutton_tooltip=Sys-worX.net virtualserver_hostbutton_url=http://www virtualserver_hostbutton_gfx_url virtualserver_queryclientsonline=1 virtualserver_download_quota=0 virtualserver_upload_quota=0 virtualserver_month_bytes_downloaded=594385 virtualserver_month_bytes_uploaded=9855 virtualserver_total_bytes_downloaded=33215251 virtualserver_total_bytes_uploaded=4974973370 virtualserver_port=10060 virtualserver_autostart=1 virtualserver_machine_id virtualserver_needed_identity_security_level=8 virtualserver_log_client=1 virtualserver_log_query=1 virtualserver_log_channel=1 virtualserver_log_permissions=1 virtualserver_log_server=1 virtualserver_log_filetransfer=1 virtualserver_min_client_version=1513163251 virtualserver_name_phonetic virtualserver_icon_id=-1231927975 virtualserver_reserved_slots=0 virtualserver_total_packetloss_speech=0.0000 virtualserver_total_packetloss_keepalive=0.0000 virtualserver_total_packetloss_control=0.0019 virtualserver_total_packetloss_total=0.0000 virtualserver_total_ping=13.0000 virtualserver_ip=0.0.0.0,\s:: virtualserver_weblist_enabled=0 virtualserver_ask_for_privilegekey=0 virtualserver_hostbanner_mode=2 virtualserver_channel_temp_delete_delay_default=0 virtualserver_min_android_version=1502275280 virtualserver_min_ios_version=1502275280 virtualserver_nickname virtualserver_status=online connection_filetransfer_bandwidth_sent=0 connection_filetransfer_bandwidth_received=0 connection_filetransfer_bytes_sent_total=60094 connection_filetransfer_bytes_received_total=0 connection_packets_sent_speech=5946676 connection_bytes_sent_speech=882149752 connection_packets_received_speech=3200713 connection_bytes_received_speech=480842868 connection_packets_sent_keepalive=1119927 connection_bytes_sent_keepalive=45917007 connection_packets_received_keepalive=1119335 connection_bytes_received_keepalive=47011877 connection_packets_sent_control=14720 connection_bytes_sent_control=1563692 connection_packets_received_control=14855 connection_bytes_received_control=2907547 connection_packets_sent_total=7081323 connection_bytes_sent_total=929630451 connection_packets_received_total=4334903 connection_bytes_received_total=530762292 connection_bandwidth_sent_last_second_total=163 connection_bandwidth_sent_last_minute_total=205 connection_bandwidth_received_last_second_total=166 connection_bandwidth_received_last_minute_total=260

Spksh commented

Your server is running TS 3.1.x, which appears to be the latest version. The last version I tested with (and the only TS server instance I have access to) is 3.0.x, and it looks like they've added at least 18 new properties to serverinfo and thus our parser is failing.

The TS3 Server Query Manual hasn't been updated since 2012, which makes it difficult to figure out what else has changed.

We'll need to:

  1. Update ServerInfoResult.cs to add the new properties, and figure out if any properties have been changed or removed (probably through trial and error)
  2. Update ServerInfoResult.cs to relax the PropertyMapping attributes so that the differences between 3.0.x and 3.1.x are not Required = true
  3. Test every other ServerQueryBaseResult in the solution against 3.1.x

List of properties returned in your serverinfo result is:

connection_bandwidth_received_last_minute_total
connection_bandwidth_received_last_second_total
connection_bandwidth_sent_last_minute_total
connection_bandwidth_sent_last_second_total
connection_bytes_received_control
connection_bytes_received_keepalive
connection_bytes_received_speech
connection_bytes_received_total
connection_bytes_sent_control
connection_bytes_sent_keepalive
connection_bytes_sent_speech
connection_bytes_sent_total
connection_filetransfer_bandwidth_received
connection_filetransfer_bandwidth_sent
connection_filetransfer_bytes_received_total
connection_filetransfer_bytes_sent_total
connection_packets_received_control
connection_packets_received_keepalive
connection_packets_received_speech
connection_packets_received_total
connection_packets_sent_control
connection_packets_sent_keepalive
connection_packets_sent_speech
connection_packets_sent_total
virtualserver_antiflood_points_needed_command_block
virtualserver_antiflood_points_needed_ip_block
virtualserver_antiflood_points_tick_reduce
virtualserver_ask_for_privilegekey
virtualserver_autostart
virtualserver_channel_temp_delete_delay_default
virtualserver_channelsonline
virtualserver_client_connections
virtualserver_clientsonline
virtualserver_codec_encryption_mode
virtualserver_complain_autoban_count
virtualserver_complain_autoban_time
virtualserver_complain_remove_time
virtualserver_created
virtualserver_default_channel_admin_group
virtualserver_default_channel_group
virtualserver_default_server_group
virtualserver_download_quota
virtualserver_filebase
virtualserver_flag_password
virtualserver_hostbanner_gfx_interval
virtualserver_hostbanner_gfx_url
virtualserver_hostbanner_mode
virtualserver_hostbanner_url
virtualserver_hostbutton_gfx_url
virtualserver_hostbutton_tooltip
virtualserver_hostbutton_url
virtualserver_hostmessage
virtualserver_hostmessage_mode
virtualserver_icon_id
virtualserver_id
virtualserver_ip
virtualserver_log_channel
virtualserver_log_client
virtualserver_log_filetransfer
virtualserver_log_permissions
virtualserver_log_query
virtualserver_log_server
virtualserver_machine_id
virtualserver_max_download_total_bandwidth
virtualserver_max_upload_total_bandwidth
virtualserver_maxclients
virtualserver_min_android_version
virtualserver_min_client_version
virtualserver_min_clients_in_channel_before_forced_silence
virtualserver_min_ios_version
virtualserver_month_bytes_downloaded
virtualserver_month_bytes_uploaded
virtualserver_name
virtualserver_name_phonetic
virtualserver_needed_identity_security_level
virtualserver_nickname
virtualserver_password
virtualserver_platform
virtualserver_port
virtualserver_priority_speaker_dimm_modificator
virtualserver_query_client_connections
virtualserver_queryclientsonline
virtualserver_reserved_slots
virtualserver_status
virtualserver_total_bytes_downloaded
virtualserver_total_bytes_uploaded
virtualserver_total_packetloss_control
virtualserver_total_packetloss_keepalive
virtualserver_total_packetloss_speech
virtualserver_total_packetloss_total
virtualserver_total_ping
virtualserver_unique_identifier
virtualserver_upload_quota
virtualserver_uptime
virtualserver_version
virtualserver_weblist_enabled
virtualserver_welcomemessage

Properties we currently map in ServerInfoResult.cs (which still matches the TS3 Server Query Manual) are:

connection_bandwidth_received_last_minute_total
connection_bandwidth_received_last_second_total
connection_bandwidth_sent_last_minute_total
connection_bandwidth_sent_last_second_total
connection_bytes_received_total
connection_bytes_sent_total
connection_filetransfer_bandwidth_received
connection_filetransfer_bandwidth_sent
connection_packets_received_total
connection_packets_sent_total
virtualserver_antiflood_points_needed_command_block
virtualserver_antiflood_points_needed_ip_block
virtualserver_antiflood_points_tick_reduce
virtualserver_ask_for_privilegekey
virtualserver_autostart
virtualserver_channelsonline
virtualserver_client_connections
virtualserver_clientsonline
virtualserver_codec_encryption_mode
virtualserver_complain_autoban_count
virtualserver_complain_autoban_time
virtualserver_complain_remove_time
virtualserver_created
virtualserver_default_channel_admin_group
virtualserver_default_channel_group
virtualserver_default_server_group
virtualserver_download_quota
virtualserver_filebase
virtualserver_flag_password
virtualserver_hostbanner_gfx_interval
virtualserver_hostbanner_gfx_url
virtualserver_hostbanner_mode
virtualserver_hostbanner_url
virtualserver_hostbutton_gfx_url
virtualserver_hostbutton_tooltip
virtualserver_hostbutton_url
virtualserver_hostmessage
virtualserver_hostmessage_mode
virtualserver_icon_id
virtualserver_id
virtualserver_ip
virtualserver_log_channel
virtualserver_log_client
virtualserver_log_filetransfer
virtualserver_log_permissions
virtualserver_log_query
virtualserver_log_server
virtualserver_machine_id
virtualserver_max_download_total_bandwidth
virtualserver_max_upload_total_bandwidth
virtualserver_maxclients
virtualserver_min_client_version
virtualserver_min_clients_in_channel_before_forced_silence
virtualserver_month_bytes_downloaded
virtualserver_month_bytes_uploaded
virtualserver_name
virtualserver_name_phonetic
virtualserver_needed_identity_security_level
virtualserver_password
virtualserver_platform
virtualserver_port
virtualserver_priority_speaker_dimm_modificator
virtualserver_query_client_connections
virtualserver_queryclientsonline
virtualserver_reserved_slots
virtualserver_status
virtualserver_total_bytes_downloaded
virtualserver_total_bytes_uploaded
virtualserver_total_packetloss_control
virtualserver_total_packetloss_keepalive
virtualserver_total_packetloss_speech
virtualserver_total_packetloss_total
virtualserver_total_ping
virtualserver_unique_identifer
virtualserver_upload_quota
virtualserver_uptime
virtualserver_version
virtualserver_weblist_enabled
virtualserver_welcomemessage

Oh ok :)

so i have to wait for a new version.

Is this fixed already now :o

Spksh commented

It's not fixed, no. Feel free to submit a PR if you have time to look at this yourself.