コード例 #1
0
ファイル: CSharpPlugin.cs プロジェクト: ickeyben123/Oxide
        public override void HandleAddedToManager(PluginManager manager)
        {
            base.HandleAddedToManager(manager);

            if (Filename != null)
            {
                Watcher.AddMapping(Name);
            }

            foreach (var name in pluginReferenceFields.Keys)
            {
                pluginReferenceFields[name].SetValue(this, manager.GetPlugin(name));
            }

            /*var compilable_plugin = CSharpPluginLoader.GetCompilablePlugin(Interface.Oxide.PluginDirectory, Name);
             * if (compilable_plugin != null && compilable_plugin.CompiledAssembly != null)
             * {
             *  System.IO.File.WriteAllBytes(Interface.Oxide.PluginDirectory + "\\" + Name + ".dump", compilable_plugin.CompiledAssembly.PatchedAssembly);
             *  Interface.Oxide.LogWarning($"The raw assembly has been dumped to Plugins/{Name}.dump");
             * }*/

            try
            {
                OnCallHook("Loaded", null);
            }
            catch (Exception ex)
            {
                Interface.Oxide.LogException($"Failed to initialize plugin '{Name} v{Version}'", ex);
                Loader.PluginErrors[Name] = ex.Message;
            }
        }
コード例 #2
0
ファイル: CSharpPlugin.cs プロジェクト: Feramor/Oxide
        public override void HandleAddedToManager(PluginManager manager)
        {
            base.HandleAddedToManager(manager);

            if (Filename != null)
            {
                Watcher.AddMapping(Name);
            }

            CallHook("Loaded", null);
        }
コード例 #3
0
ファイル: CSharpPlugin.cs プロジェクト: Ansj88/Oxide
        public override void HandleAddedToManager(PluginManager manager)
        {
            base.HandleAddedToManager(manager);

            if (Filename != null)
            {
                Watcher.AddMapping(Name);
            }

            foreach (var name in pluginReferences.Keys)
            {
                pluginReferences[name].SetValue(this, manager.GetPlugin(name));
            }

            CallHook("Loaded", null);
        }
コード例 #4
0
ファイル: PythonPlugin.cs プロジェクト: Feramor/Oxide
        /// <summary>
        /// Called when this plugin has been added to the specified manager
        /// </summary>
        /// <param name="manager"></param>
        public override void HandleAddedToManager(PluginManager manager)
        {
            // Call base
            base.HandleAddedToManager(manager);

            // Subscribe all our hooks
            foreach (string key in Globals)
            {
                Subscribe(key);
            }

            // Add us to the watcher
            watcher.AddMapping(Name);

            // Let the plugin know that it's loading
            CallFunction("Init", null);
        }