diff --git a/README.md b/README.md index 8de3bc4..1942d52 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# mysql_auth +# MySQL Authentication Plug Minetest's auth mechanism into a MySQL database. -# Configuration +## Configuration First, if mod security is enabled (`secure.enable_security = true`), this mod must be added as a trusted mod (in the `secure.trusted_mods` config entry). There is **no** other solution to make it work under mod security. -By default `mysql_auth` doesn't run in singleplayer. This can be overriden by setting +By default, `mysql_auth` doesn't run in singleplayer. This can be overriden by setting `mysql_auth.enable_singleplayer` to `true`. Configuration may be done as regular Minetest settings entries, or using a config file, allowing @@ -37,7 +37,7 @@ db.db = nil -- <== Setting this is required ### Lua table config file Connection options are passed as a table through the `db.connopts` entry. -Its format must be the same as [LuaPower's MySQL module `mysql.connect(options_t)` function][mycn], +It's format must be the same as [LuaPower's MySQL module `mysql.connect(options_t)` function][mycn], that is (all members are optional); ```lua @@ -113,11 +113,11 @@ mysql_auth.db.db = minetest mysql_auth.db.tables.auth.name = skyblock_auths ``` -# License +## License -`mysql_auth` is licensed under [LGPLv3](https://www.gnu.org/licenses/lgpl.html). +`mysql_auth` is licensed under [GNU LGPLv3](https://www.gnu.org/licenses/lgpl.html). Using the Public Domain-licensed LuaPower `mysql` module. -[mycn]: https://luapower.com/mysql#mysql.connectoptions_t---conn +[mycn]: https://luapower.com/mysql#mysql.connectoptions_t---conn \ No newline at end of file diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 2170244..0000000 --- a/depends.txt +++ /dev/null @@ -1,2 +0,0 @@ -mysql_base - diff --git a/init.lua b/init.lua index f26fc4b..a7c2ba2 100644 --- a/init.lua +++ b/init.lua @@ -16,7 +16,7 @@ end local singleplayer = minetest.is_singleplayer() -- Caching is OK since you can't open a game to -- multiplayer unless you restart it. -if not minetest.setting_get(modname .. '.enable_singleplayer') and singleplayer then +if not minetest.settings:get(modname .. '.enable_singleplayer') and singleplayer then LogI("Not adding auth handler because of singleplayer game") return end diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..491febf --- /dev/null +++ b/mod.conf @@ -0,0 +1,3 @@ +name = mysql_auth +depends = mysql_base +description = Source auth entries in a MySQL database. \ No newline at end of file