Skip to content
Permalink
Browse files

Fixed channellist query command

  • Loading branch information...
Splamy committed Oct 24, 2019
1 parent 0f7c7b2 commit eb56a2f8f7e5fdc12a84294276b8ad5b3c6db3d4
Showing with 97 additions and 96 deletions.
  1. +1 −1 TS3Client/Declarations
  2. +87 −87 TS3Client/Generated/Messages.cs
  3. +7 −6 TS3Client/Generated/Versions.cs
  4. +2 −2 TS3Client/Ts3BaseClient.cs
Submodule Declarations updated 2 files
+23 −1 Messages.toml
+35 −0 Versions.csv
@@ -753,93 +753,6 @@ public void Expand(IMessage[] to, IEnumerable<string> flds)
}
}

public sealed class ChannelData : IResponse
{

public string ReturnCode { get; set; }

public ChannelId Id { get; set; }
public ChannelId ParentChannelId { get; set; }
public DurationSeconds DurationEmpty { get; set; }
public i32 TotalFamilyClients { get; set; }
public i32 TotalClients { get; set; }
public i32 NeededSubscribePower { get; set; }
public ChannelId Order { get; set; }
public str Name { get; set; }
public str Topic { get; set; }
public bool IsDefault { get; set; }
public bool HasPassword { get; set; }
public bool IsPermanent { get; set; }
public bool IsSemiPermanent { get; set; }
public Codec Codec { get; set; }
public u8 CodecQuality { get; set; }
public i32 NeededTalkPower { get; set; }
public IconHash IconId { get; set; }
public i32 MaxClients { get; set; }
public i32 MaxFamilyClients { get; set; }

public void SetField(string name, ReadOnlySpan<byte> value, Deserializer ser)
{
switch(name)
{

case "id": { if(Utf8Parser.TryParse(value, out ChannelId oval, out _)) Id = oval; } break;
case "pid": { if(Utf8Parser.TryParse(value, out ChannelId oval, out _)) ParentChannelId = oval; } break;
case "seconds_empty": { if(Utf8Parser.TryParse(value, out f64 oval, out _)) DurationEmpty = TimeSpan.FromSeconds(oval); } break;
case "total_clients_family": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) TotalFamilyClients = oval; } break;
case "total_clients": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) TotalClients = oval; } break;
case "channel_needed_subscribe_power": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) NeededSubscribePower = oval; } break;
case "channel_order": { if(Utf8Parser.TryParse(value, out ChannelId oval, out _)) Order = oval; } break;
case "channel_name": Name = Ts3String.Unescape(value); break;
case "channel_topic": Topic = Ts3String.Unescape(value); break;
case "channel_flag_default": IsDefault = value.Length > 0 && value[0] != '0'; break;
case "channel_flag_password": HasPassword = value.Length > 0 && value[0] != '0'; break;
case "channel_flag_permanent": IsPermanent = value.Length > 0 && value[0] != '0'; break;
case "channel_flag_semi_permanent": IsSemiPermanent = value.Length > 0 && value[0] != '0'; break;
case "channel_codec": { if(Utf8Parser.TryParse(value, out u8 oval, out _)) Codec = (Codec)oval; } break;
case "channel_codec_quality": { if(Utf8Parser.TryParse(value, out u8 oval, out _)) CodecQuality = oval; } break;
case "channel_needed_talk_power": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) NeededTalkPower = oval; } break;
case "channel_icon_id": { if(!value.IsEmpty && value[0] == (u8)'-') { if(Utf8Parser.TryParse(value, out i32 oval, out _)) IconId = oval; } else { if(Utf8Parser.TryParse(value, out u64 oval, out _)) IconId = unchecked((i32)oval); } } break;
case "channel_maxclients": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) MaxClients = oval; } break;
case "channel_maxfamilyclients": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) MaxFamilyClients = oval; } break;
case "return_code": ReturnCode = Ts3String.Unescape(value); break;
}

}

public void Expand(IMessage[] to, IEnumerable<string> flds)
{
var toc = (ChannelData[])to;
foreach (var fld in flds)
{
switch(fld)
{

case "id": foreach(var toi in toc) { toi.Id = Id; } break;
case "pid": foreach(var toi in toc) { toi.ParentChannelId = ParentChannelId; } break;
case "seconds_empty": foreach(var toi in toc) { toi.DurationEmpty = DurationEmpty; } break;
case "total_clients_family": foreach(var toi in toc) { toi.TotalFamilyClients = TotalFamilyClients; } break;
case "total_clients": foreach(var toi in toc) { toi.TotalClients = TotalClients; } break;
case "channel_needed_subscribe_power": foreach(var toi in toc) { toi.NeededSubscribePower = NeededSubscribePower; } break;
case "channel_order": foreach(var toi in toc) { toi.Order = Order; } break;
case "channel_name": foreach(var toi in toc) { toi.Name = Name; } break;
case "channel_topic": foreach(var toi in toc) { toi.Topic = Topic; } break;
case "channel_flag_default": foreach(var toi in toc) { toi.IsDefault = IsDefault; } break;
case "channel_flag_password": foreach(var toi in toc) { toi.HasPassword = HasPassword; } break;
case "channel_flag_permanent": foreach(var toi in toc) { toi.IsPermanent = IsPermanent; } break;
case "channel_flag_semi_permanent": foreach(var toi in toc) { toi.IsSemiPermanent = IsSemiPermanent; } break;
case "channel_codec": foreach(var toi in toc) { toi.Codec = Codec; } break;
case "channel_codec_quality": foreach(var toi in toc) { toi.CodecQuality = CodecQuality; } break;
case "channel_needed_talk_power": foreach(var toi in toc) { toi.NeededTalkPower = NeededTalkPower; } break;
case "channel_icon_id": foreach(var toi in toc) { toi.IconId = IconId; } break;
case "channel_maxclients": foreach(var toi in toc) { toi.MaxClients = MaxClients; } break;
case "channel_maxfamilyclients": foreach(var toi in toc) { toi.MaxFamilyClients = MaxFamilyClients; } break;
}
}

}
}

public sealed class ChannelDelete : INotification
{
public NotificationType NotifyType { get; } = NotificationType.ChannelDelete;
@@ -1908,6 +1821,93 @@ public void Expand(IMessage[] to, IEnumerable<string> flds)
}
}

public sealed class ChannelListResponse : IResponse
{

public string ReturnCode { get; set; }

public ChannelId ChannelId { get; set; }
public ChannelId ParentChannelId { get; set; }
public ChannelId Order { get; set; }
public str Name { get; set; }
public i32 TotalClients { get; set; }
public i32 NeededSubscribePower { get; set; }
public str Topic { get; set; }
public bool? IsDefault { get; set; }
public bool? HasPassword { get; set; }
public bool? IsPermanent { get; set; }
public bool? IsSemiPermanent { get; set; }
public Codec? Codec { get; set; }
public u8? CodecQuality { get; set; }
public i32? NeededTalkPower { get; set; }
public i32? TotalFamilyClients { get; set; }
public i32? MaxClients { get; set; }
public i32? MaxFamilyClients { get; set; }
public IconHash? IconId { get; set; }
public DurationSeconds? DurationEmpty { get; set; }

public void SetField(string name, ReadOnlySpan<byte> value, Deserializer ser)
{
switch(name)
{

case "cid": { if(Utf8Parser.TryParse(value, out ChannelId oval, out _)) ChannelId = oval; } break;
case "pid": { if(Utf8Parser.TryParse(value, out ChannelId oval, out _)) ParentChannelId = oval; } break;
case "channel_order": { if(Utf8Parser.TryParse(value, out ChannelId oval, out _)) Order = oval; } break;
case "channel_name": Name = Ts3String.Unescape(value); break;
case "total_clients": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) TotalClients = oval; } break;
case "channel_needed_subscribe_power": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) NeededSubscribePower = oval; } break;
case "channel_topic": Topic = Ts3String.Unescape(value); break;
case "channel_flag_default": IsDefault = value.Length > 0 && value[0] != '0'; break;
case "channel_flag_password": HasPassword = value.Length > 0 && value[0] != '0'; break;
case "channel_flag_permanent": IsPermanent = value.Length > 0 && value[0] != '0'; break;
case "channel_flag_semi_permanent": IsSemiPermanent = value.Length > 0 && value[0] != '0'; break;
case "channel_codec": { if(Utf8Parser.TryParse(value, out u8 oval, out _)) Codec = (Codec)oval; } break;
case "channel_codec_quality": { if(Utf8Parser.TryParse(value, out u8 oval, out _)) CodecQuality = oval; } break;
case "channel_needed_talk_power": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) NeededTalkPower = oval; } break;
case "total_clients_family": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) TotalFamilyClients = oval; } break;
case "channel_maxclients": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) MaxClients = oval; } break;
case "channel_maxfamilyclients": { if(Utf8Parser.TryParse(value, out i32 oval, out _)) MaxFamilyClients = oval; } break;
case "channel_icon_id": { if(!value.IsEmpty && value[0] == (u8)'-') { if(Utf8Parser.TryParse(value, out i32 oval, out _)) IconId = oval; } else { if(Utf8Parser.TryParse(value, out u64 oval, out _)) IconId = unchecked((i32)oval); } } break;
case "seconds_empty": { if(Utf8Parser.TryParse(value, out f64 oval, out _)) DurationEmpty = TimeSpan.FromSeconds(oval); } break;
case "return_code": ReturnCode = Ts3String.Unescape(value); break;
}

}

public void Expand(IMessage[] to, IEnumerable<string> flds)
{
var toc = (ChannelListResponse[])to;
foreach (var fld in flds)
{
switch(fld)
{

case "cid": foreach(var toi in toc) { toi.ChannelId = ChannelId; } break;
case "pid": foreach(var toi in toc) { toi.ParentChannelId = ParentChannelId; } break;
case "channel_order": foreach(var toi in toc) { toi.Order = Order; } break;
case "channel_name": foreach(var toi in toc) { toi.Name = Name; } break;
case "total_clients": foreach(var toi in toc) { toi.TotalClients = TotalClients; } break;
case "channel_needed_subscribe_power": foreach(var toi in toc) { toi.NeededSubscribePower = NeededSubscribePower; } break;
case "channel_topic": foreach(var toi in toc) { toi.Topic = Topic; } break;
case "channel_flag_default": foreach(var toi in toc) { toi.IsDefault = IsDefault; } break;
case "channel_flag_password": foreach(var toi in toc) { toi.HasPassword = HasPassword; } break;
case "channel_flag_permanent": foreach(var toi in toc) { toi.IsPermanent = IsPermanent; } break;
case "channel_flag_semi_permanent": foreach(var toi in toc) { toi.IsSemiPermanent = IsSemiPermanent; } break;
case "channel_codec": foreach(var toi in toc) { toi.Codec = Codec; } break;
case "channel_codec_quality": foreach(var toi in toc) { toi.CodecQuality = CodecQuality; } break;
case "channel_needed_talk_power": foreach(var toi in toc) { toi.NeededTalkPower = NeededTalkPower; } break;
case "total_clients_family": foreach(var toi in toc) { toi.TotalFamilyClients = TotalFamilyClients; } break;
case "channel_maxclients": foreach(var toi in toc) { toi.MaxClients = MaxClients; } break;
case "channel_maxfamilyclients": foreach(var toi in toc) { toi.MaxFamilyClients = MaxFamilyClients; } break;
case "channel_icon_id": foreach(var toi in toc) { toi.IconId = IconId; } break;
case "seconds_empty": foreach(var toi in toc) { toi.DurationEmpty = DurationEmpty; } break;
}
}

}
}

public sealed class ChannelMove : INotification
{
public NotificationType NotifyType { get; } = NotificationType.ChannelMove;
@@ -64,12 +64,13 @@ public VersionSign(string name, string platform, ClientPlatform platformType, st
public static VersionSign VER_LIN_3_X_X { get; } = new VersionSign("3.?.? [Build: 5680278000]", "Linux", ClientPlatform.Linux, "Hjd+N58Gv3ENhoKmGYy2bNRBsNNgm5kpiaQWxOj5HN2DXttG6REjymSwJtpJ8muC2gSwRuZi0R+8Laan5ts5CQ==");
public static VersionSign VER_IOS_3_X_X { get; } = new VersionSign("3.?.? [Build: 5680278000]", "iOS", ClientPlatform.Ios, "XrAf+Buq6Eb0ehEW/niFp06YX+nGGOS0Ke4MoUBzn+cX9q6G5C0A/d5XtgcNMe8r9jJgV/adIYVpsGS3pVlSAA==");
public static VersionSign VER_AND_3_X_X { get; } = new VersionSign("3.?.? [Build: 5680278000]", "Android", ClientPlatform.Android, "AWb948BY32Z7bpIyoAlQguSmxOGcmjESPceQe1DpW5IZ4+AW1KfTk2VUIYNfUPsxReDJMCtlhVKslzhR2lf0AA==");
public static VersionSign VER_MAC_5_0_0 { get; } = new VersionSign("5.0.0-alpha.385 [Build: 1570480817]", "macOS", ClientPlatform.MacOs, "tgmX8pvk2XSvVlmTNlSF7zteBfSdG+vQujanrpg73B6TZVpIMW52aC8E/p2X+jvYm09DNm8MVeUOPglfGtadCA==");
public static VersionSign VER_WIN_5_0_0 { get; } = new VersionSign("5.0.0-alpha.384 [Build: 1570457406]", "Windows", ClientPlatform.Windows, "6FmjeQaMhIELrglADHocwtXPH8XWODz5UOJDwa3wDDuVMX/K9Vnyh6+MrSR9UT+TuGBnVXtSYGpNeKL7i9LNCA==");
public static VersionSign VER_LIN_5_0_0 { get; } = new VersionSign("5.0.0-alpha370 [Build: 1569948695]", "Linux", ClientPlatform.Linux, "JwzqAbSxXDTD9VLF4BZhOFYu2etYzwqg3TmN/50WSejPvs0Dkb66wu6llyhRBVTE/GB5o/vQxlsFjrP2rM3ADQ==");
public static VersionSign VER_WIN_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1568734736]", "Windows", ClientPlatform.Windows, "fyTB0CPBTj0jVd4NTUy8oBJ1PiGhrHpano2wGvEmzzZxb8A0A1BkRdmCyZP2hxJI8iLMnpEIy3SEXADl8kjRAg==");
public static VersionSign VER_MAC_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1568734736]", "OS X", ClientPlatform.MacOs, "cD1hdW/GpYEHd42RTeKVVqTPbMlcGNNYLbsrjE3bX3NNyBEw+EFDn6JiXjvJ2nlgkwt/BG1CqTjeTPxCWhg4Cw==");
public static VersionSign VER_LIN_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1568734736]", "Linux", ClientPlatform.Linux, "YU9jsFPaBFg9CEr4g2lUBhZj6e6f2l7EFI9grYLMB/BLPWu9B7k+aGzAe9OkMHXpT3Q0cqc+k+N7XSxXf8x0Dw==");
public static VersionSign VER_WIN_5_0_0 { get; } = new VersionSign("5.0.0-beta.9 [Build: 1571949734]", "Windows", ClientPlatform.Windows, "m04/1RI/r2RM6aHwRrvENlB0/Px6UnZwE2Lqo7IgQiB4MpFRmAgMu7g/gVB9NdWeMdhm5ulsM5lyYrcu7dyfBA==");
public static VersionSign VER_MAC_5_0_0 { get; } = new VersionSign("5.0.0-beta.9 [Build: 1571949734]", "macOS", ClientPlatform.MacOs, "Y+qroeb12dDsCO+OTuoERTLgTUWihZ076cODxmo6iyNPPVS9xy1zq8hv1lEtc4UcC3EAqusBRS2ikKY6PnsdAQ==");
public static VersionSign VER_LIN_5_0_0 { get; } = new VersionSign("5.0.0-beta.8 [Build: 1571671044]", "Linux", ClientPlatform.Linux, "ANXPHY1ZJlhEPAxngYChDm3XRU0XZntITzHlnZmBGRQOednkyAeZV+/DthWmYmgd0diJt1+qTnI3LNyB8PcUBA==");
public static VersionSign VER_WIN_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1571080050]", "Windows", ClientPlatform.Windows, "4XIHXqnhLM6dRNFzdkNcbWxK/nX6iLBECc+6UJPX4PooBDyWOzul6yF1NKe/fg7bZDigZir1+OENu+O/tLwHDw==");
public static VersionSign VER_MAC_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1571080050]", "OS X", ClientPlatform.MacOs, "64wKoleYoqOwO2t4bCHaQevSlv6HyvU5vpOF+yjuIrbqT1um1VoIQuL3L9BKt10Em2sd6VR1/IciCVuTSNd+BQ==");
public static VersionSign VER_LIN_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1571080050]", "Linux", ClientPlatform.Linux, "glUVQf9FU2STvK2jzW328FkF1AhrPLj27sVo9TzEC+2Qg7phv5UpczW9SGTyp3H0KCofYfmTR6OW/W/1tCoeBQ==");
public static VersionSign VER_IOS_3_5_0 { get; } = new VersionSign("3.5.0 [Build: 1570810399]", "iOS", ClientPlatform.Ios, "RdN1+nQ2YRxJi66Yd8ta7CXUMsisWTU64qGNDTyuV2vdO/+vYQz6qOUaWjwDxzw3JAXr8FfCPcPaPo3suJj7AA==");
public static VersionSign VER_WIN_3_3_2 { get; } = new VersionSign("3.3.2 [Build: 1566767614]", "Windows", ClientPlatform.Windows, "fAjM3pPl95eGXrhFcsvCXgdI6Epr8XpafOJZlYbFws2VMllYy/4DUleSVzPuVqu/TCgrTaqb0wP+KANse3/vAw==");
public static VersionSign VER_MAC_3_3_2 { get; } = new VersionSign("3.3.2 [Build: 1566767614]", "OS X", ClientPlatform.MacOs, "JiKoykMS5BExaAEMpIYB3JRH+YturPua/Q+VTQxJGRi002zni9b8ReitLaJJQt2EMcNAbDpl57um4mekqFvGBA==");
public static VersionSign VER_LIN_3_3_2 { get; } = new VersionSign("3.3.2 [Build: 1566767614]", "Linux", ClientPlatform.Linux, "UhiFNnz8npgT22qkLXlZJnX3T2n+a8usv/0cTh+tgybrgsFd2WIuI3eabWCibPeU+AYeHLaeYR+x+pF4GX/NDw==");
@@ -194,8 +194,8 @@ private CmdR BanClient(ICommandPart clientIdentifier, string reasonMsg = null, T
{ "time", duration?.TotalSeconds },
});

public R<ChannelData[], CommandError> ChannelList(ChannelListOptions options = 0)
=> Send<ChannelData>("channellist",
public R<ChannelListResponse[], CommandError> ChannelList(ChannelListOptions options = 0)
=> Send<ChannelListResponse>("channellist",
new CommandOption(options));

/// <summary>Displays a list of clients online on a virtual server including their ID, nickname, status flags, etc.

0 comments on commit eb56a2f

Please sign in to comment.
You can’t perform that action at this time.