Plugin update checker for spigot and bukkit plugins

Discussion in 'Plugin Requests' started by foxi69, Dec 29, 2015.

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

    foxi69

    Hello everyone!

    I have already seen a lot of plugin updater for bukkit plugins, but no one created what works with this sites both.

    So I have to request it!
     
  2. Offline

    ItsBRZY

    Just to clarify, you wont a plugin that detects updates for spigot / bukkit plugins on both of their websites?
     
  3. Online

    timtower Administrator Administrator Moderator

    @foxi69 This is very difficult, first you need to find the plugin link, then the files, version number (where everybody is using a different format), then you need to compare them.
    Have a plugin hosted on dropbox and everything breaks.

    It is better to ask the developers to add this to their own plugins.
     
  4. Code:
        try {
           HttpURLConnection c = (HttpURLConnection)new URL("http://www.spigotmc.org/api/general.php").openConnection();
           c.setDoOutput(true);
           c.setRequestMethod("POST");
           c.getOutputStream().write(("key=98BE0FE67F88AB82B4C197FAF1DC3B69206EFDCC4D3B80FC83A00037510B99B4&resource=/*insert id of resource here*/").getBytes("UTF-8"));
           String oldVersion = this.getDescription().getVersion();
           String newVersion = new BufferedReader(new InputStreamReader(c.getInputStream())).readLine().replaceAll("[a-zA-Z ]", "");
           if(!newVersion.equals(oldVersion)) {
             //there is a new version
           }
         }
         catch(Exception e) {
           //update failed, most likely to spigot being down or the server not having internet connection
         }
    That's what you could use for Spigot, Idk what you can try for Bukkit, but I hope this will get you further ^-^
     
  5. Online

    timtower Administrator Administrator Moderator

    @Pr0totype2 That is at least a part, now getting the project ID etc.
     
  6. Aren't the plugins sorted by ID?
     
  7. Online

    timtower Administrator Administrator Moderator

    Nope, the ID that you are talking about only exists on the download page, it isn't located in the plugin.
     
  8. That's what I meant, but you can update the code depending on what ID the plugin is being registered at on the download page, right?
     
  9. Online

    timtower Administrator Administrator Moderator

    You can, but then the developer of that plugin needs to have the ID in the plugin already, nobody does that.
     
  10. You can always update your plugin lol
    That won't break the plugin's ID
     
  11. Online

    timtower Administrator Administrator Moderator

    @Pr0totype2 Then it might be better to tell them to add an auto-updater.
     
  12. Hmm, what do you mean by this?
     
  13. Online

    timtower Administrator Administrator Moderator

    Instead of telling the developers to add an ID to their plugin let them add their own auto-updater.
     
  14. Wouldn't that require them to use an external source instead of the Bukkit plugin-page thingy?
     
  15. Online

    timtower Administrator Administrator Moderator

    Nope, Gravity made a Bukkit version.
     
  16. Offline

    mrCookieSlime

    zThana likes this.
  17. That's exactly what I meant lol
    Even tho, you can only get the ID by posting the resource first, but the author could always update the plugin to implement automatic updates.
     
  18. Offline

    mrCookieSlime

    Correct.
    It is almost the same for Bukkit.
    On BukkitDev you will have to have the Project up and running before you can get the ID as well.
    You could ask a member of staff for your ID of course, but you would normally have to upload a File in order for your Project to be approved.
    So in both ways Updaters could mostly only be added in the second Version of the Plugin.

    However I think the OP is asking for a Plugin which automatically updates ALL Plugins on the Server, not just itself.
    In that case retrieving the ID from an external Plugin isn't that easy unless you use a Service like https://spiget.org/
    which is not going to be 100% reliable though.

    @foxi69
    Your best bet would be to ask the Authors of the Plugins you are using to add an Auto-Updater to their Plugin.
    Doing this via another Plugin is not going to be as flawless as you would expect.
     
  19. Online

    timtower Administrator Administrator Moderator

    @mrCookieSlime Then you first need the link though, so my point still stands.
     
    UnseenMC Network likes this.
  20. Your point still stands, even tho, it's not a big deal to update your plugin after you've posted your plugin...
     
Thread Status:
Not open for further replies.

Share This Page