1. Calytic

    Calytic Community Admin Community Mod

    Hi there,

    I am writing a mod that keeps track of plugin dependencies and reloads mods according to their dependencies.

    It occurs to me that this really shouldn't be a mod but part of Oxide itself.

    If I have a ton of dependencies set up, I have to let the server load every mod completely, then reiterate over them to ensure it was loaded in the correct order. This is an unnecessarily complicated and messy process.

    This problem could be solved in two ways, both by providing a configurable plugin load order. Either I give my dependency manager mod priority which forces it to always load first (therein allowing me to check dependencies as the server boots), or I let the dependency manager build the entire Load Order which therefore removes the need for a run-time dependency manager et all.

    So, like other popular modding frameworks, would it be possible to get a configurable load order (perhaps stored as a JSON file like the user data)?
    [DOUBLEPOST=1438113475,1438104764][/DOUBLEPOST]Load order is referenced at server start and when using "oxide.reload *"/ReloadAll

    We don't need to be able to check plugin dependencies on an individual plugin Reload. Simply using the Load Order as an initialization/ReloadAll vector would suffice. A mod could handle all runtime dependencies using the hooks you have already added.
     
  2. C# Plugins already support plugin dependencies as far as I know. Overall though I would say plugins should be able to handle if their dependencies are not loaded yet. I don't see the benefit from adding it into core. Oxide is open source so feel free to submit a pr with the changes needed to add plugin dependencies: https://github.com/OxideMod/Oxide


    C# Magic comment requires.
    //Requires: PluginName
    //Requires: PluginName
     
  3. Wulf

    Wulf Community Admin

    Plugin dependencies would be better than a user-configured load order, and as Hatemail mentioned, you can already add dependencies in C# plugins.
     
  4. Calytic

    Calytic Community Admin Community Mod

    Alright cool! Is the dependency magic on the roadmap in the non-C# modules? I assume the answer to that question is yes.

    Thanks.
     
  5. Wulf

    Wulf Community Admin

    Ideally yes, just a matter of getting to it. We'd like to have equal features across all languages.
     
  6. HI!
    Would there be a way to interact with oxide to define a plugin load order ?
     
  7. Wulf

    Wulf Community Admin

    No, plugins are currently loaded A-Z. There's an existing request about being able to change the priority though. What exactly are you needing to do?
     
  8. My plugins are not loaded from A to Z, i don"t know why. I need to some of them load it in a certain order
     
  9. Wulf

    Wulf Community Admin

    Oxide loads plugins A-Z by plugin type (.cs, .js, .py, .lua) I believe. Why do you need them to load in a certain order?
     
  10. OCD :p
     
  11. But would be a nice feature, to handle plugins using duplicate commands. Would be easier than editing the plugin code.
    I assume the last plugin get the hook ?

    Or maybe use a new plugin naming format like :
    Code:
    0-plugin1
    0-plugin2
    0-plugin3
    1-plugin4
    1-plugin5
    1-plugin6
    2-plugin7
    3-plugin8
    etc.
    (like friends and logger for rust experimental for example)
    But would need the cooperation of all plugin devs.
     
  12. Wulf

    Wulf Community Admin

    Friends API isn't named that anymore, it isn't needed. Logger does it so that it gets called first so it can cancel all; it isn't about the load order.

    Changing the load order is not a solution for duplicate commands. The plugin devs should either not be using commands that are that generate, server owners shouldn't be using plugins that handle the same things, or plugins devs should offer an option in the config to change commands. It's the responsibility of the server owner to know what commands the plugins they are using provide and change or request changes as needed.
     
  13. Changing the plugins filename resolved this for me so thanks for that, but it would be nice if they did allow a user to specify a plugin order because there are case scenarios where it's not a dependency issue . For instance i'm working on a stats plugins and because of load order, another plugin that modified gather amounts was loading after my plugin and therefore my plugin stats were incorrect.