Closed XoMEX closed 8 years ago
Can't confirm that error, please provide a way to reproduce the issue you want to fix.
Dim _rChannelCreate As Responses.SingleValueResponse(Of UInteger?)
Dim _ChannelModification As New Server.Entities.ChannelModification With {.Name = "QueryChannelName", _
.IsPermanent = True}
_rChannelCreate = _qRunner.CreateChannel(_ChannelModification)
PrintDebugLine(_rChannelCreate.StatusText)
-> error id=0 msg=ok / Channel created with no exception. Server Version: 3.0.10.3 (01.01.2014 17:28:39) on Linux
if (QueryRunner.Login("serveradmin", "<pwd>").IsErroneous)
{
MessageBox.Show("login error");
return;
}
QueryRunner.SelectVirtualServerById(1);
QueryRunner.RegisterForNotifications(ServerNotifyRegisterEvent.Channel,0);
ChannelModification c = new ChannelModification();
c.IsPermanent = false;
c.IsSemiPermanent = false;
c.IsTemporary = true;
c.ParentChannelId = 6;
c.ChannelOrder= null;
c.Name = "abc";
SingleValueResponse<uint?> res = QueryRunner.CreateChannel(c);
the problem is, it tries to convert "289\n\rnotifychannelcreated" to an uint.
When thinking about my solution right now (i've made it a while back) I see the problem, but don't know how to fix that in a good way...
For what do you need this line?
QueryRunner.RegisterForNotifications(ServerNotifyRegisterEvent.Channel,0);
In this example, for reproducing the bug. But I use this API in a bot which needs to listen to client moves, and those are a channelevent.
Year, but where do you handle the ServerNotifyRegisterEvent - didn't found a way to handle the event. There's only a UnknownNotificationReceived Event which won't be triggered.
In my Bot I use
QueryRunner.Notifications.ClientMoved += Notifications_ClientMoved;
QueryRunner.Notifications.ClientMoveForced += Notifications_ClientMoveForced;
For me it seems like the QueryRunner waits for a Responses.SingleValueResponse(Of UInteger?)
but receives a ServerNotifyRegisterEvent
which has an other structure.
It mixes two things up, cause those lines come more or less at the same time: the channel creation, and the event the channelcration triggers (and maybe the move, because its a temporary channel).
Here's the Traffic caused in the example
< TS3
Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.
> login client_login_name=serveradmin client_login_password=<pwd>
< error id=0 msg=ok
> use sid=1
< error id=0 msg=ok
> servernotifyregister event=channel id=0
< error id=0 msg=ok
> channelcreate channel_name=abc channel_flag_permanent=0 channel_flag_semi_permanent=0 channel_flag_temporary=1 cpid=6
< cid=300
< notifychannelcreated cid=300 cpid=6 channel_name=abc channel_order=0 channel_flag_permanent=0 channel_flag_semi_permanent=0 invokerid=3 invokername=serveradmin\sfrom\s127.0.0.1:20843 invokeruid=serveradmin
< notifyclientmoved ctid=300 reasonid=1 invokerid=0 invokername=Server clid=3
notifyclientmoved ctid=300 reasonid=1 invokerid=0 invokername=Server clid=3
error id=0 msg=ok
A quick hotfix for #5