Exemplo n.º 1
0
        protected override void Shutdown()
        {
            this.InvokeOperationSafely(() =>
            {
                this.Core.CharacterFilter.LoginComplete -= CharacterFilter_LoginComplete;
                this.Core.CharacterFilter.Logoff -= CharacterFilter_Logoff;
                this.CoreManager.PluginInitComplete -= CoreManager_PluginInitComplete;

                this.ClientDispatch -= RTWrapperPlugin_ClientDispatch;
                this.ServerDispatch -= RTWrapperPlugin_ServerDispatch;

                this._wrappedPlugin.WrappedShutdown();
                this._wrappedPlugin = null;
                this._pluginBaseEventsHelper = null;

                _instance = null;
            });
        }
Exemplo n.º 2
0
        protected override void Startup()
        {
            this.InvokeOperationSafely(() =>
            {
                _instance = this;

                this.Core.CharacterFilter.LoginComplete += CharacterFilter_LoginComplete;
                this.Core.CharacterFilter.Logoff += CharacterFilter_Logoff;
                this.CoreManager.PluginInitComplete += CoreManager_PluginInitComplete;
                //CoreManager.Current.PluginInitComplete += Current_PluginInitComplete;

                this._pluginBaseEventsHelper = new PluginBaseEventsHelper();

                this.ClientDispatch += RTWrapperPlugin_ClientDispatch;
                this.ServerDispatch += RTWrapperPlugin_ServerDispatch;

                this._wrappedPlugin = WrapperUtilities.CreateWrappedPluginInstance("RedoxExtensions");
                this._wrappedPlugin.WrappedStartup(this, this._pluginBaseEventsHelper);
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Called when a character logs in
        /// </summary>
        private void Initialize()
        {
            lock (this._classLock)
            {
                // Some how initialize was called multiple times.  Ignore it
                if (this._initializeComplete)
                {
                    WrapperDebugWriter.WriteToStaticLog("RT", "Skipping Initialize.  Already Complete");
                    return;
                }

                try
                {
                    // Cache ourself with the F# layer so that the library code can access decal
                    // singletons
                    PluginProvider.Set(this);

                    this._settings = RTSettings.Resume(this.CharacterFilter.Name);

                    this._errorLogger = new ErrorLogger(this, "RT");
                    this._debugWriter = new DebugWriter(this, "RT", "RT");
                    this._chatWriter = new ChatWriter(this, "RT");

                    // If not using wrapper, we have to hook up the logic to support the plugin base events
                    if (this._realPluginBaseEvents == null)
                    {
                        this._pluginBaseEventsHelper = new PluginBaseEventsHelper();
                        this.ClientDispatch += RTPlugin_ClientDispatch;
                        this.ServerDispatch += RTPlugin_ServerDispatch;
                    }

                    //this.TryInitializeExternalPluginDependencies();

                    this._eventsManager = new EventsManager();

                    this._dispatchManager = new DispatchManager(this.Events.Decal);

                    this._monitorManager = new MonitorManager((IREEventsFireCallbacks)this.Events.RE);

                    this._commandListenerManager = new CommandListenerManager(this.Events.Decal);

                    this.Chat.WriteLine("***Initialization Complete****");
                }
                finally
                {
                    this._initializeComplete = true;

                    // Reset close down flag
                    this._closeDownComplete = false;
                }
            }
        }