Remove node disallowing feature.

This was buggy and something that should be handled by a protection mod.
This commit is contained in:
GunshipPenguin 2015-08-29 15:20:22 -07:00
parent fcbf5d17fd
commit af7da98395
3 changed files with 0 additions and 23 deletions

View File

@ -74,9 +74,6 @@ with the canafk privilege can remain afk indefenetly.
+ First time join message:
+ Shows a message when a player joins the server for the first time.
+ Node disallowing:
+ Disallow placement of certain blocks, players with the disallowednodes priv can place them.
+ Chat spam kicking:
+ Automatically kick players who send chat messages that are greater than a certian length.

View File

@ -17,7 +17,6 @@ minetest.register_privilege("heal", "Player can heal other players with the /hea
minetest.register_privilege("top", "Player can use the /top command")
minetest.register_privilege("setspeed", "Player can set player speeds with the /setspeed command")
minetest.register_privilege("whois", "Player can view other player's network information with the /whois command")
minetest.register_privilege("disallowednodes", "Player can place nodes in the DISALLOWED_NODES table")
minetest.register_privilege("chatspam", "Player can send chat messages longer than MAX_CHAT_MSG_LENGTH without being kicked")
if AFK_CHECK then
@ -248,21 +247,6 @@ minetest.register_on_newplayer(function(player)
end
end)
minetest.register_on_placenode(function(pos, newNode, placer, oldnode, itemStack, pointed_thing)
for _,nodeName in pairs(DISALLOWED_NODES) do
if nodeName == newNode["name"] then
if minetest.check_player_privs(placer:get_player_name(), {disallowednodes=true}) then
return
else
minetest.remove_node(pos)
minetest.chat_send_player(placer:get_player_name(), "You cannot place the node " .. newNode["name"])
end
end
end
return
end)
minetest.register_on_chat_message(function(name, message)
if KICK_CHATSPAM and not minetest.check_player_privs(name, {chatspam=true}) and string.len(message) > MAX_CHAT_MSG_LENGTH then
minetest.kick_player(name, "You were kicked because you sent a chat message longer than " .. MAX_CHAT_MSG_LENGTH .. " characters. This is to prevent chat spamming.")

View File

@ -8,9 +8,5 @@ FIRST_TIME_JOIN_MSG = " has joined the server for the first time, Welcome!" --Me
BROADCAST_PREFIX = "[SERVER]" --All messages sent with the /broadcast command will be prefixed with this
DISALLOWED_NODES = { --These nodes will be immediatly removed if they are placed. Players with the disallowednodes priv can place them
"tnt:tnt",
}
KICK_CHATSPAM = true --If true, players who send a chat message longer than MAX_CHAT_MSG_LENGTH will be kicked
MAX_CHAT_MSG_LENGTH = 400