What is it?
This mod allows mod makers to specify download urls for their mods, and then download them and future updates from this mod, automatically if preferred.
How does it work?
You specify INITIAL_URL (the parent directory for version.txt and updatelists.txt)
--This tells the mod to look here for the list of files to download and version. (must be a parent directory, ompldr will not work. It needs specific filenames.
You can then specify UPDATE_ON_NEW_VERSION.
--If this is true, this mod downloads updatechecker, creates a config file for it, and allows it to run with other mods. This makes a full-cycle auto-update system.
When you run the mod, it downloads all the files found in updatelists.txt and places them in their respective directories as a modpack.
If UPDATE_ON_NEW_VERSION is set to true, then it also installes updatechecker and adds a config file that specifies the LOCAL_VERSION (for comparing versions) and SOURCE_URL that has the orignal URL.
When the updatechecker is run, if there is a new version, it deletes modpack.txt which causes UpdateSystem to be run again.
Safety:
This mod is not malicious, but it does demonstrate how other mods could take advantage of cURL to be malicious.
Config files:
If a filename has "config" in it's name, it is not replaced when updating. This will allow you to preserve configurations.
Download:
Download: https://github.com/Traxie21/updatesystem/archive/master.zip
Github: https://github.com/Traxie21/updatesystem
NOTE: by default, this downloads the unstable version of ServerExtended. It can be changed by modifying INITIAL_URL in init.lua
Compatability:
This will work on any Linux system that has cURL installed.
It should also work on Windows if cURL is in the PATH variable, but no promises.
License:
Code: WTFPL
Modders:
Feel free to include this with your mods, using a custom INITIAL_URL, I'd actually recommend it!
This works best with GitHub.
FILE HIREARCHY, MUST BE CORRECT:
-INITIAL_URL
|-updatelists.txt
|-version.txt
Format for updatelists.txt:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local url, file, dir = ""
url = "https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_api/init.lua"
file = "init.lua"
dir = "/se_api/"
add_file(url, file, dir)
url = "https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_startup/init.lua"
file = "init.lua"
dir = "/se_startup/"
add_file(url, file, dir)
url is location of file you are downloading.
file is the name of the file you will write to.
dir is the name of the directory "file" will be created in.
If you want auto-updating to work, you must also add version.txt:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
version = 1.0
if you add a variable called never_update, then you can also prevent auto-updating this mod.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
version = 1.0
never_update = true
Example output (/update downloading default ServerExtended)
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
[Updater]: Current version is: 0.5
[Updater]: Server up to date!
[ServerExtended] ServerExtended Version 0.5 Loaded!
[ServerExtended] Loading ServerExtended Modules...
[ServerExtended] Ranks Module Loaded
[ServerExtended] TeleportRequest Module Loaded
[ServerExtended] Homes Module Loaded
[ServerExtended] Warps Module Loaded
[ServerExtended] Player Extras Commands Module Loaded
[ServerExtended] Admin Tools Commands Module Loaded
[ServerExtended] Gui Module Loaded
creative inventory size: 220
Font size: 8 17
[Updater]: Removing (/home/traxie21/Minetest/minetest/bin/../mods/minetest/serverextended/updater/../modpack.txt)
[Updater]: Getting update lists from (https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/updatelists.txt) ...
[Updater]: Downloading (/se_api/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_api/init.lua.
[Updater]: Downloading (/se_startup/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_startup/init.lua.
[Updater]: Downloading (/se_ranks/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_ranks/init.lua.
[Updater]: Downloading (/se_homes/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_homes/init.lua.
[Updater]: Downloading (/se_warps/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_warps/init.lua.
[Updater]: Downloading (/se_tpr/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_tpr/init.lua.
[Updater]: Downloading (/se_gui/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_gui/init.lua.
[Updater]: Downloading (/se_admin_tools/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_admin_tools/init.lua.
[Updater]: Downloading (/se_player_extras/init.lua) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_player_extras/init.lua.
[Updater]: Downloading (/se_api/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_api/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_startup/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_startup/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_ranks/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_ranks/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_homes/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_homes/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_warps/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_warps/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_tpr/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_tpr/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_gui/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_gui/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_admin_tools/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_admin_tools/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_player_extras/config.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_player_extras/config.txt.
Not overwriting file (config.txt)
[Updater]: Downloading (/se_api/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_api/depends.txt.
[Updater]: Downloading (/se_startup/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_startup/depends.txt.
[Updater]: Downloading (/se_ranks/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_ranks/depends.txt.
[Updater]: Downloading (/se_homes/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_homes/depends.txt.
[Updater]: Downloading (/se_warps/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_warps/depends.txt.
[Updater]: Downloading (/se_tpr/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_tpr/depends.txt.
[Updater]: Downloading (/se_gui/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_gui/depends.txt.
[Updater]: Downloading (/se_admin_tools/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_admin_tools/depends.txt.
[Updater]: Downloading (/se_player_extras/depends.txt) from https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/se_player_extras/depends.txt.
[Updater]: Getting update lists from (https://raw.github.com/Traxie21/ServerExtended--Unstable-/master/version.txt) ...
version = 0.5
Thats all for now! Updates coming soon!