minetest-mods / inspector

A minetest node inspector tool that shows various properties of nodes.
GNU Lesser General Public License v2.1
9 stars 8 forks source link

I18n, prevent tool use by non-server players, fix "/inspect a b c" crash #14

Open FaceDeer opened 4 years ago

FaceDeer commented 4 years ago

This started out just adding guards against players without the "server" priv using the inspector tool. The chat command /inspect was server-only so I figured that made sense, just in case a server admin accidentally drops an inspector tool or it otherwise winds up in the hands of the common player.

I reflexively wrapped the "you're not authorized" message in S(), however, and then realized that this mod didn't have locale support. So I did that and it became the main event of this change. The "i18n.py" script I included is the one that's been crafted in the update_translations project, I included it so future modders have a one-click way of updating the template.txt file.

And while I was going about this I noticed that you could crash the game by using "/inspect a b c" (any non-numeric parameter mixed in will do, as long as there's three parameters). So I fixed that too.