@@ -263,16 +263,16 @@ func (s *ServerMethods) Stop(id int) error {
263263
264264// Group represents a virtual server group.
265265type Group struct {
266- ID int `ms:"sgid"`
266+ ID int `ms:"sgid"`
267267 Name string
268268 Type int
269269 IconID int
270270 Saved bool `ms:"savedb"`
271271 SortID int
272272 NameMode int
273- ModifyPower int `ms:"n_modifyp"`
274- MemberAddPower int `ms:"n_member_addp"`
275- MemberRemovePower int `ms:"n_member_addp"`
273+ ModifyPower int `ms:"n_modifyp"`
274+ MemberAddPower int `ms:"n_member_addp"`
275+ MemberRemovePower int `ms:"n_member_addp"`
276276}
277277
278278// GroupList returns a list of available groups for the selected server.
@@ -349,6 +349,133 @@ type OnlineClient struct {
349349 AwayMessage string `ms:"client_away_message"`
350350}
351351
352+ // Like OnlineClient but with much more information.
353+ type DetailedOnlineClient struct {
354+ OnlineClient `ms:",squash"`
355+
356+ // Milliseconds since the client did something, for example sending
357+ // a message, muting themselves or talking.
358+ IdleTime int64 `ms:"client_idle_time"`
359+
360+ UniqueIdentifier string `ms:"client_unique_identifier"`
361+
362+ // Which version of the Teamspeak client application this client uses.
363+ Version string `ms:"client_version"`
364+
365+ // What platform the client is running on. For example "Windows".
366+ Platform string `ms:"client_platform"`
367+
368+ // True if the client has their microphone muted
369+ InputMuted bool `ms:"client_input_muted"`
370+
371+ // True if the client has their speakers muted
372+ OutputMuted bool `ms:"client_output_muted"`
373+ OutputOnlyMuted bool `ms:"client_outputonly_muted"`
374+
375+ // False if the client has their microphone disabled, for example
376+ // because they unplugged it. Do not confuse this with InputMuted.
377+ InputHardware bool `ms:"client_input_hardware"`
378+
379+ // False if the client has their speakers disabled, for example
380+ // because they are unplugged. Do not confuse this with OutputMuted.
381+ OutputHardware bool `ms:"client_output_hardware"`
382+
383+ // Takes the form of "/channelID"
384+ DefaultChannel string `ms:"client_default_channel"`
385+
386+ //TODO: I never managed to receive any value for this field
387+ //MetaData interface{} `ms:"client_meta_data"`
388+
389+ IsRecording bool `ms:"client_is_recording"`
390+ VersionSign string `ms:"client_version_sign"`
391+ SecurityHash string `ms:"client_security_hash"`
392+ LoginName string `ms:"client_login_name"`
393+ ChannelGroupId int `ms:"client_channel_group_id"`
394+ Servergroups int `ms:"client_servergroups"`
395+
396+ // UTC timestamp at which the client has been created.
397+ Created int64 `ms:"client_created"`
398+
399+ // UTC timestamp at which the client has been online for the last time.
400+ // Not when the connection was established but when it was closed.
401+ LastConnected int64 `ms:"client_lastconnected"`
402+
403+ // How often the client has connected to the server.
404+ Totalconnections int `ms:"client_totalconnections"`
405+
406+ // Empty or a string of 32 hexadecimal characters. Indicates whether the
407+ // client has set an avatar or not.
408+ FlagAvatar string `ms:"client_flag_avatar"`
409+
410+ TalkPower int `ms:"client_talk_power"`
411+ TalkRequest bool `ms:"client_talk_request"`
412+ TalkRequestMsg string `ms:"client_talk_request_msg"`
413+ Description string `ms:"client_description"`
414+
415+ // Indicates whether the client is able to talk or not.
416+ //TODO: This is always 0, even if my talk power is high enough?
417+ IsTalker bool `ms:"client_is_talker"`
418+
419+ MonthBytesUploaded int64 `ms:"client_month_bytes_uploaded"`
420+ MonthBytesDownloaded int64 `ms:"client_month_bytes_downloaded"`
421+ TotalBytesUploaded int64 `ms:"client_total_bytes_uploaded"`
422+ TotalBytesDownloaded int64 `ms:"client_total_bytes_downloaded"`
423+ IsPrioritySpeaker bool `ms:"client_is_priority_speaker"`
424+ NicknamePhonetic string `ms:"client_nickname_phonetic"`
425+ NeededServerqueryViewPower int `ms:"client_needed_serverquery_view_power"`
426+ DefaultToken string `ms:"client_default_token"`
427+
428+ // CRC32 checksum of the client icon
429+ IconId uint32 `ms:"client_icon_id"`
430+
431+ IsChannelCommander bool `ms:"client_is_channel_commander"`
432+
433+ // For example "DE" for Germany.
434+ Country string `ms:"client_country"`
435+
436+ ChannelGroupInheritedChannelId int `ms:"client_channel_group_inherited_channel_id"`
437+
438+ //TODO: I always got "overwolf=0". I assume it is a list of "key=value|key2=value2...". In that case, the type of this should be a map (or maybe an array, if it's only true/false).
439+ //Badges string `ms:"client_badges"`
440+
441+ Base64HashClientUID string `ms:"client_base64HashClientUID"`
442+
443+ // Current bandwidth used for outgoing file transfers (Bytes/s)
444+ ConnectionFiletransferBandwidthSent int `ms:"connection_filetransfer_bandwidth_sent"`
445+ // Current bandwidth used for incoming file transfers (Bytes/s)
446+ ConnectionFiletransferBandwidthReceived int `ms:"connection_filetransfer_bandwidth_received"`
447+
448+ ConnectionPacketsSentTotal int64 `ms:"connection_packets_sent_total"`
449+ ConnectionBytesSentTotal int64 `ms:"connection_bytes_sent_total"`
450+ ConnectionPacketsReceivedTotal int64 `ms:"connection_packets_received_total"`
451+ ConnectionBytesReceivedTotal int64 `ms:"connection_bytes_received_total"`
452+
453+ // Average bandwidth used for outgoing data in the last second (Bytes/s)
454+ ConnectionBandwidthSentLastSecondTotal int `ms:"connection_bandwidth_sent_last_second_total"`
455+ // Average bandwidth used for outgoing data in the last minute (Bytes/s)
456+ ConnectionBandwidthSentLastMinuteTotal int `ms:"connection_bandwidth_sent_last_minute_total"`
457+ // Average bandwidth used for incoming data in the last second (Bytes/s)
458+ ConnectionBandwidthReceivedLastSecondTotal int `ms:"connection_bandwidth_received_last_second_total"`
459+ // Average bandwidth used for incoming data in the last minute (Bytes/s)
460+ ConnectionBandwidthReceivedLastMinuteTotal int `ms:"connection_bandwidth_received_last_minute_total"`
461+ // Milliseconds since the client connected to the server.
462+ ConnectionConnectedTime int64 `ms:"connection_connected_time"`
463+
464+ // For example "83.123.45.6". According to the manual this is always IPv4.
465+ ConnectionClientIp string `ms:"connection_client_ip"`
466+ }
467+
468+ // ClientInfo returns detailed information about a single online client.
469+ func (s * ServerMethods ) ClientInfo (clientID int ) (* DetailedOnlineClient , error ) {
470+ var client DetailedOnlineClient
471+ if _ , err := s .ExecCmd (NewCmd ("clientinfo" ).WithArgs (NewArg ("clid" , clientID )).WithResponse (& client )); err != nil {
472+ return nil , err
473+ }
474+
475+ client .ID = clientID // the clientinfo command does not include the clid in the result set
476+ return & client , nil
477+ }
478+
352479// ClientList returns a list of online clients.
353480func (s * ServerMethods ) ClientList () ([]* OnlineClient , error ) {
354481 var clients []* OnlineClient
0 commit comments