Пример #1
0
        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;
            }
        }