public string Disconnect()
        {
            if (!client.Connected)
            {
                return("Not connected!");
            }

            MusicPlayer.State = State.Stopped;
            StopMic();
            StopVoice();

            client.Disconnect();
            return("Ok");
        }
Example #2
0
 static void Dispose()
 {
     exit = true;
     if (client.Connected)
     {
         client.OnConnected    -= OnConnected;
         client.OnDisconnected -= OnDisconnected;
         client.OnErrorEvent   -= OnErrorEvent;
         client?.Disconnect();
     }
     Console.ReadLine();
     //Console.ReadKey(true);
     Environment.Exit(0);
 }
Example #3
0
        private void TsFullClient_OnErrorEvent(object sender, CommandError e)
        {
            switch (e.Id)
            {
            case Ts3ErrorCode.whisper_no_targets:
                stallNoErrorCount = 0;
                isStall           = true;
                break;

            case Ts3ErrorCode.client_could_not_validate_identity:
                autoReconnectOnce = true;
                int targetSecLevel = int.Parse(e.ExtraMessage);
                Log.Write(Log.Level.Info, "Calculating up to required security level: {0}", targetSecLevel);
                Ts3Crypt.ImproveSecurity(identity, targetSecLevel);
                ts3FullClientData.IdentityOffset = identity.ValidKeyOffset;

                tsFullClient.Disconnect();
                break;

            default:
                Log.Write(Log.Level.Debug, e.ErrorFormat());
                break;
            }
        }
Example #4
0
 public static void DisposeTS()
 {
     client.Disconnect();
     client.Dispose();
 }