Auto Updater

Discussion in 'Plugin Development' started by Vidsify, Dec 12, 2014.

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

    Vidsify

    Hi can someone help me adding an auto updater to my plugin. I have added this code to my main class file in my onEnable():

    Code:
    if (getConfig().getBoolean("AutoUpdate", true)) {
              @SuppressWarnings("unused")
            Updater localUpdater = new Updater(this, id, getFile(), Updater.UpdateType.DEFAULT, true);
            } else {
              getLogger().info("NOT AUTO-UPDATING");
            }
    
        }
    I am using Gravity's updater so I have added their updater class file to my plugin as well. The problem is I don't know how to get my ID. Can someone explain. If its the Server API Key its a really long number and when I try to use that for some reason I get errors flying up all over the place.

    I'm also getting errors in the updater.class file and I'm not sure why?

    Thanks in advance

    Vidsify
     
  2. Offline

    Lolmewn

    Errors in the Updater class? What kind?
     
  3. Offline

    Vidsify

    @AdamQpzm So do I copy and past all that and add it to where id is?
     
  4. @Vidsify No, what you need to do is visit the link, replacing "yourPlugin" with the name of your plugin as you uploaded it to bukkitdev. On the page, it should display some details, like this:

    So you can see, the id for one of my plugins is 85467. You'll want to visit the page for your plugin and note down your id, which you'll use in the updater. :)
     
  5. Offline

    Vidsify

    Last edited: Dec 12, 2014
  6. @Vidsify Yup! If you still can't get it to work after entering the id (80039 by what you've posted) then let us know :)
     
  7. Offline

    Vidsify

  8. @Vidsify You never declared those variables.

    As a side note, I see we have some things in common - I too took Phyiscs and Chemistry (but never did or see anyone do the DofE) :p
     
  9. Offline

    Vidsify

    @AdamQpzm ah lol ok and yeah I do maths, physics, chemistry and computer science. In my first year of AS. I've change the code to this:

    upload_2014-12-12_18-42-1.png

    But getting a yellow line :/
     
  10. @Vidsify That warning is most likely an "unused" warning, since you never use that variable after that line :)
     
  11. Offline

    Vidsify

    @AdamQpzm Shall I add an express warning to it? or just leave it
     
  12. @Vidsify You can just leave it if you want, but I'd recommend actually using it :) For example, there's a getResult() method that will allow you to actually see what the result of the updater was, might be useful :p
     
  13. Offline

    Vidsify

    @AdamQpzm I'm a bit nooby with this updater never done it before. What do you mean?
     
Thread Status:
Not open for further replies.

Share This Page