Introducing a dependency to an auto-updating plugin

Discussion in 'Plugin Development' started by caseif, Apr 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    caseif

    I plan on releasing a new version of a plugin of mine soon, but it introduces a dependency (sorry, had to do the shameless plug :p) that is required for it to load. However, it also includes an auto-updater which silently updates the it to the latest version when the server loads. Obviously, this creates a problem. I can only hope that when server owners realize the plugin isn't loading, they rush to the BukkitDev page and see that the dependency was added, but nonetheless, I'm sure I'll get plenty of tickets and comments about how it suddenly stopped working (server owners can be really oblivious sometimes). Is there a way to make the update go a bit more smoothly, or will I have to deal with the inevitable chaos that will ensue if I proceed as-is?
     
  2. Offline

    AoH_Ruthless

    ShadyPotato
    For the next update set auto-updater to false in config (assuming that's where you allow it to be disabled) so it doesn't create that issue. However, of course users that have your plugin won't be able to download it as quickly because they will not know there is an update.

    Alternatively, you can let the updater run and as soon as the server restarts, if the plugin that you depend on isn't there, broadcast a message saying it's not there then disable the plugin.
     
  3. Offline

    caseif

    AoH_Ruthless That's not quite the answer I was looking for, but your suggestion gave me an idea: I'll use a soft dependency, then when the plugin loads, check if the dependency is installed. If not, I'll download it and log a message explaining what just happened. That's in accordance with DBO ToS, right? :/
     
  4. Or you could just check if the dependency isn't found, and set a repeating task that will broadcast a warning message that you need to get the dependency. Just a thought :D
     
  5. Offline

    caseif

    The thing is, it is actually a hard dependency. I would need to set it as soft so that I could execute code even if the dependency wasn't found, but still have it be loaded after it. I would need to disable the plugin if it couldn't access it, though, so broadcasting a message is out of the question.
     
  6. True, thats a tough one
     
  7. Offline

    AoH_Ruthless

    ShadyPotato

    That's a brilliant idea, and yes it should be part of the Bukkit ToS, but to be safe, PM or report your post to a forums mod or BukkitDev Staff member (Some of them don't like being tagged!)
     
  8. Offline

    caseif

    I'm checking with the folks on the IRC right now. Apparently, it's somewhat of a gray area, but I'll keep looking.
     
  9. Offline

    Garris0n

    What exactly is the gray area? Adding a dependency? That doesn't seem like a "gray area", it's just a dependency...
     
  10. Offline

    AoH_Ruthless

    Garris0n
    No, the current idea is that on start up, load the updated version of the dependency plugin, which ShadyPotato might not have rights to do. If there is no way to disable that (which there can't be), then it also might not be allowed.
     
  11. Offline

    Garris0n

    So you're saying that it would auto-install another plugin? I don't see any problem with it "legally" (it's just downloading from DBO), but they're technically not consenting to the download.
     
  12. Offline

    AoH_Ruthless

    That's why I am unsure if it's approved. :) BukkitDev is pretty big on the whole consent thing (as they should be, don't get me wrong I'm not opposed to it) and I don't know if something like this would be approved.
     
  13. Offline

    Garris0n

    I say the plugin should either add a direct dependency or a soft dependency and auto disable (cleaner than a stack trace, I suppose).
     
  14. Offline

    caseif

    Just to play it safe, I think what I'll do is only have the plugin function if the dependency is found (which will be marked as a soft dependency), and then allow the server owner to use a single command to download and install it if they wish.
     
Thread Status:
Not open for further replies.

Share This Page