Page 1 of 1

How does the modding thing work, is my init.lua file downloaded?

PostPosted: Thu Oct 10, 2013 01:49
by bbqroast
Hey.

I'm writing a plugin that uses MySQL for some stuff. I understand that Minetest allows for client side modding (ie new blocks, textures, etc) from the server. Obviously this requires the client to download resources, would these resources include the init.lua file? And if so how can I secure my code from being downloaded?

While I'm not worried about other people using it, as it connects to MySQL it contains the passwords to the DB. Ideally the DB would only accept internal connections but I'd still prefer to keep the password safe.

PostPosted: Thu Oct 10, 2013 02:08
by VanessaE
Mod Lua code is stored and run only on the server. Media files such as textures, sounds, and models are sent to the client. The Lua code is never sent to the clients. That said, we don't generally condone the idea of hidden or "protected" code.

Either release your code or don't, but don't spend time trying to "protect" it from view. This is an open source game and engine, and mods written for it need to be as well. It's just better for the Minetest ecosystem that way.

PostPosted: Thu Oct 10, 2013 02:18
by bbqroast
I think you misunderstand how this works.

I'm planning on releasing the code. However, in order for it to function the server owner must put in the address, username and password of a MySQL server. If the player can see this then they could possibly connect to the MySQL server and modify the values with in it directly.

My concern was that the Minetest server would sync the client with the file, and any poweruser could find the code and extract the passwords which are configured by the server's admin. The code will be open and free to use, it's a proof of concept port of a Minecraft plugin which is opensource anyway.

TL;DR The code is hidden, in the same way that when developing a email client you don't put all your emails on Github.

Also, a trivial question: Is there a page listing the frequencies of various ores?

PostPosted: Thu Oct 10, 2013 07:59
by rubenwardy
The player will not be able to see the user/pass

Ores: https://github.com/minetest/minetest_game/blob/master/mods/default/mapgen.lua#L34