1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

API Mod auto-updates

Discussion in 'Community Dev Corner' started by Shadlington, May 3, 2014.

Mods: Downburst, Mazey
  1. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    Although I posted about this in a recent announcement thread, I thought it'd be useful to have a dedicated thread for any questions or feedback about the latest addition to the mod distribution/verification system: mod auto-updating.

    Mod auto-update system

    What is this? It means that as a server owner you can setup your mods to auto-update whenever the mod developer makes a new release of their mod. This also includes the initial install of the mod, so you don't have to use FTP or w/e to upload files to your server, you just need to add a line to your mods.cfg and the server will do the rest.

    However, this only works for mods for which mod developers have registered and uploaded their mods to the Web API. Developers: use this app to do that: https://forum.kag2d.com/resources/kag-mod-manager.153/ (make sure you have the latest version if you've used it before). Also, make sure you the 'full'* checkbox is ticked when you're registering/updating your mod.

    Now, how do server owners configure their servers to do this? Lets say there's a mod that's been uploaded to the API which you'd like to setup to auto-update on your server.
    To do this, you just have to add a line to your mods.cfg. Up till now the lines in mods.cfg have just been the folder name that the mods are in. However, now you can add ' = dev:nameURL' to one of those lines (after the folder name), where dev is the mod's dev (either a username or devgroup) and nameURL is the mod's name URL field. Doing this will setup the mod that is identified with that dev:nameURL pair to auto-update, downloading into the folder specified.

    Here's an example, based on Rayne's Islandrekt:
    "Islandrekt = rayne:islandrekt"

    This will download islandrekt and put it in Mods/Islandrekt for you.

    Other details
    • Any mod downloaded by the auto-update system will be verified, because the Web API ensures that the registration.json files in the downloaded package are up-to-date. So, blue thumbs-ups on the server browser are guaranteed if all your mods are installed in this way (or at least should be - if you're still having problems with getting verified please PM me, attaching the mod in question in a .zip/.tar.gz file so I can investigate).
    • Mod devs: There is a special hard-coded path in your mod you can use to put .cfg files that you want to allow server owners to modify without failing verification: /settings (e.g. Islandrekt/settings - it should be in the top level of the mod's directory). When a server is auto-updating a mod it will try to preserve the .cfg files in this settings folder, provided that the mod package doesn't have copies of the .cfg files in it. So to make optimal use of this you should include default values for any settings file in your scripts (i.e. it should work even if the .cfg files are missing) and include a .cfg.example file showing the expected file format - server owners could then make a .cfg copy of these examples, which would not be overwritten by the auto-update.
    • I suggest that, for convenience, mod developers post their dev:nameURL identifiers in their respective forum threads, but anyone can look up these details (plus whether or not the mod is available for this auto-update process) via the mod manager app.
    Please post any feedback, questions, suggestions you might have in this thread.
    * Those tickboxes will be useful in the future, but for now the only one that's supported by the game/auto-updates is 'full'.
     
    Noburu likes this.
  2. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    So, it would be really great if all the mod devs (at least the ones that aren't specifically developing mods for use only on their own servers - though even those ones might find this useful as a means of updating their server & keeping it verified) could upload their mods to the API (via the mod manager app), so people could take advantage of this system.
     
    Noburu likes this.
  3. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    I'll do for my future mod.
    And I'll ask Diprog to do it for the fun CTF and showing this link to Zen Laboratories guys.
     
  4. Yantex

    Yantex :^)) Donator
    1. Angels of Death - [AoD]

    Messages:
    148
    Yes! Finally so simple.
     
    meaow likes this.
  5. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Would be nice if you made a simple website where you can search for URL's dev's and whatnot. So you don't have to check resources and hope they placed it there.
    Minimal css required, just something like a simple table or whatever.

    e: shad rl more
     
  6. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    Yeah I was thinking about doing something like that. Literally anyone could do it though, so maybe someone else will do it before I get around to it.
     
  7. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Like how devs wanted to stimulate people to start modding by making shiprekt? nope
     
  8. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    Well, people did make things like this server browser http://kag.ques.to/

    Anyways, I might do it after I'm done with exams. Would definitely be cool if someone in the community did it first though.
     
    Mazey likes this.
  9. LucasTT

    LucasTT Haxor Tester

    Messages:
    455
    Last edited: May 4, 2014
    Shadlington likes this.
  10. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    You're showing the mod names but you need to show name url field too, as that is what goes in the mods.cfg file.
    Ideally, show it as dev:nameURL so server owners can just copy and paste that directly.
     
    Mazey likes this.
  11. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
  12. LucasTT

    LucasTT Haxor Tester

    Messages:
    455
    @Mazey stop complaining and do yourself.
    Anyway, I'll do the table.
     
    Asu and Rayne like this.
  13. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    I would if you hadn't lol
     
  14. LucasTT

    LucasTT Haxor Tester

    Messages:
    455
    Shadlington and Konfitur like this.
  15. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Please add 'Sort by name/dev name' or something. Also +1000 for the table, looks WAY better.
     
  16. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    Yeah that's much better. Also +1 for sort options.
    Also, 'avaliable' -> 'available'
     
    Last edited: May 6, 2014
    Asu and Mazey like this.
  17. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    Time for a bit of CSS?
     
  18. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    No? It can't get better with css at all.
     
  19. LucasTT

    LucasTT Haxor Tester

    Messages:
    455
    Asu likes this.
  20. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    Could you specifically remove shadlington:test from the results? Its just there for me to check everything is working still, so would probably be best if it wasn't in your results.

    Looking good though :)
     
Mods: Downburst, Mazey