示例#1
0
文件: Bot.cs 项目: HellBz/TS3AudioBot
        public void Dispose()
        {
            BotManager.RemoveBot(this);

            lock (SyncRoot)
            {
                if (!IsDisposed)
                {
                    IsDisposed = true;
                }
                else
                {
                    return;
                }
                Log.Info("Bot disconnecting.");

                PluginManager.StopPlugins(this);

                PlayManager.Stop();
                PlayManager = null;

                PlayerConnection.Dispose();                 // before: logStream,
                PlayerConnection = null;

                QueryConnection.Dispose();                 // before: logStream,
                QueryConnection = null;
            }
        }
示例#2
0
        public void Dispose()
        {
            BotManager.RemoveBot(this);

            lock (SyncRoot)
            {
                if (!IsDisposed)
                {
                    IsDisposed = true;
                }
                else
                {
                    return;
                }
                Log.Info("Bot ({0}) disconnecting.", Id);

                PluginManager.StopPlugins(this);

                PlayManager.Stop();
                PlayManager = null;

                PlayerConnection.Dispose();
                PlayerConnection = null;

                ClientConnection.Dispose();
                ClientConnection = null;
            }
        }