Example #1
0
        /// <summary>
        /// Handler for the TSConnection's TalkStatusChanged Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TsConnection_TalkStatusChanged(object sender, TS3QueryLib.Core.Client.Notification.EventArgs.TalkStatusEventArgs e)
        {
            string name;
            if (this.clients.ContainsKey(e.ClientId))
                name = this.clients[e.ClientId].Name;
            else
                name = "UNKNOWN";

            logger.Trace("TalkStatusChanged: {0} {1}", name, e.TalkStatus);

            TalkStatus internalStatus = TalkStatus.Unknown;
            switch (e.TalkStatus)
            {
                case TS3QueryLib.Core.Client.Notification.Enums.TalkStatus.TalkStarted:
                    internalStatus = TalkStatus.TalkStarted;
                    break;
                case TS3QueryLib.Core.Client.Notification.Enums.TalkStatus.TalkFinished:
                    internalStatus = TalkStatus.TalkStopped;
                    break;
                default:
                    break;
            }

            this.RaiseTalkStatusChanged(new Data.TalkStatusEventArgs(e.ClientId, name, internalStatus, e.IsWisper));
        }
Example #2
0
 protected void OnClientMoved(TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs args)
 {
     if (ClientMoved != null)
         ClientMoved(this, args);
 }
Example #3
0
 private void OnTextMessage(TS3QueryLib.Core.Server.Notification.EventArgs.MessageReceivedEventArgs args)
 {
     if (MessageReceived != null)
         MessageReceived(this, args);
 }
Example #4
0
 /// <summary>
 /// Handler for the TalkStatusChanged event
 /// </summary>
 private void EventQueryRunner_TalkStatusChanged(object sender, TS3QueryLib.Core.Client.Notification.EventArgs.TalkStatusEventArgs e)
 {
     // Handle the notification on a background task
     Task.Factory.StartNew(() =>
     {
         lock (this.connectionLock)
         {
             this.RaiseTalkStatusChanged(e);
         }
     });
 }
Example #5
0
 /// <summary>
 /// Event MessageReceived
 /// Sends TalkEvent to Text synthesiser
 /// </summary>
 private void Notifications_MessageReceived(object sender, TS3QueryLib.Core.Server.Notification.EventArgs.MessageReceivedEventArgs e)
 {
     TeamspeakReader.ChatReader.AddTextToQueue(e.InvokerNickname + " " + e.Message, e.InvokerNickname);
 }
Example #6
0
 private void QueryDispatcher_BanDetected(object sender, TS3QueryLib.Core.Common.EventArgs<SimpleResponse> e)
 {
     Console.WriteLine("You're account was banned!\nError-Message: {0}\nBan-Message:{1}", e.Value.ErrorMessage, e.Value.BanExtraMessage);
 }