Page 1 of 1

[General] best practice for mod developers?

PostPosted: Fri Jan 06, 2012 22:24
by sapier
When updating my server I regularly get in trouble about not even knowing what version of a mod I'm just running. I thought about it and had some ideas to improove this. Probably someone has ideas too or thinks I'm wrong so please post your opinion!

I do suggest as best practice for every mod:

1) Mod has a unique name
2) each release of a module has a unique version number
3) on load print module name and version number
3) (optional) custom version number printed on load for mods not modified by original author

Having module version number available in minetest eg by /modinfo might be good too. But this might need changes in minetest.

PostPosted: Fri Jan 06, 2012 22:30
by robin
Better write yourself a tool to compare states

1) data/mods/<modname>
2) hash over the all files
3) no need
4) generate list of all recipes
5) generate list of all nodes/crafts/etc
6) compare recipes/nodes/crafts/etc for duplicates.

PostPosted: Fri Jan 06, 2012 22:36
by Hackeridze
robin wrote:Better write yourself a tool to compare states

1) data/mods/<modname>
2) hash over the all files
3) no need
4) generate list of all recipes
5) generate list of all nodes/crafts/etc
6) compare recipes/nodes/crafts/etc for duplicates.

+1

PostPosted: Fri Jan 06, 2012 23:04
by sapier
good idea too

4) generate list of all recipes
5) generate list of all nodes/crafts/etc
6) compare recipes/nodes/crafts/etc for duplicates.


should be done by minetest on load of module craft/node/item registration ... at least in my oppinion

PostPosted: Mon Jan 09, 2012 08:42
by Baŝto
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
modname = {}
modname.name = "modname"
modname.version = "0.00"
modname.modpath = dump(minetest.get_modpath("modname"))
print("mod '"..modname.name.."' v"..modname.version.." loaded at "..modname.modpath)

PostPosted: Mon Jan 09, 2012 10:48
by redcrab
sapier wrote:When updating my server I regularly get in trouble about not even knowing what version of a mod I'm just running. I thought about it and had some ideas to improove this. Probably someone has ideas too or thinks I'm wrong so please post your opinion!

I do suggest as best practice for every mod:

1) Mod has a unique name
2) each release of a module has a unique version number
3) on load print module name and version number
3) (optional) custom version number printed on load for mods not modified by original author

Having module version number available in minetest eg by /modinfo might be good too. But this might need changes in minetest.


+1 it's a good practice for mod developper

-may be also, a lua API to register a lua function that provide full mod name and version, by this way any player may request the mods list and/or get a the full name and description of a particular mod , on-line.
-may be also the mod provide the doc, for detailed description, for nodes and recipe ... doc reachable by the minetest client.