~gpcf/misc-patches

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] add serverpass_get command

Details
Message ID
<20211019130411.14458-1-git.maverick2797@gmail.com>
DKIM signature
missing
Download raw message
Patch: +14 -1
 - add "serverpass_get" command to show current server password
 - change "serverpass" to "serverpass_set" to differentiate from above
---
 init.lua | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 init.lua

diff --git a/init.lua b/init.lua
old mode 100644
new mode 100755
index b9a603a..bdb1476
--- a/init.lua
+++ b/init.lua
@@ -450,7 +450,7 @@ local xr = {
minetest.register_chatcommand("xban_record", xr)
minetest.register_chatcommand("xr", xr)

minetest.register_chatcommand("serverpass", {
minetest.register_chatcommand("serverpass_set", {
	description = "set a server password",
	params = "<password>",
	privs = { kick=true },
@@ -459,6 +459,19 @@ minetest.register_chatcommand("serverpass", {
		minetest.chat_send_player(name, "Changed server password to \""..param.."\".")
	end
})
minetest.register_chatcommand("serverpass_get", {
	description = "view the server password",
	params = "",
	privs = { kick=true },
	func = function(name,param)
		local pass = minetest.settings:get("default_password")
		if not pass or pass == "" then
			minetest.chat_send_player(name,"No password set. Server is open to the public")
		else
			minetest.chat_send_player(name,"Current password: \""..pass.."\"")
		end
	end
})

minetest.register_chatcommand("xban_wl", {
	description = "Manages the whitelist",
-- 
2.33.0
Details
Message ID
<87lf2pp33c.fsf@knoblauch.gpcf.eu>
In-Reply-To
<20211019130411.14458-1-git.maverick2797@gmail.com> (view parent)
DKIM signature
missing
Download raw message
The current way how we use this function was to set a random password to
prevent new users from joining at all, so if people wanted to join, we
reset the password to some known value, and let people join.
Reply to thread Export thread (mbox)