Doors overriding protection mods...

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Doors overriding protection mods...

by TenPlus1 » Sun Feb 16, 2014 16:09

When using either protector, protector+ or Areas mod, users are still able to place doors inside protected areas and it seems the door mod itself may be the problem... Any chance of looking into this peeps ? :) Thanks...
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Sun Feb 16, 2014 17:31

I solved this problem on the stair/-plus, doors and bucket mods for my server.
Sorry when I break here some licenses - whatever, I hate "security leaks"
Here, the one of the doors:
games/minetest_game/mods/doors/init.lua wrote:Beginning at line #63:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if minetest.is_protected(pt, placer:get_player_name()) then
     minetest.chat_send_player(placer:get_player_name(), "This area is protected. You can not place that node here.", true)
     return itemstack
end


For the bucket mod:
games/minetest_game/mods/bucket/init.lua wrote:Beginning at line #59:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
--A nice addon for lava griefers:
if pos.y > -5 and source == "default:lava_source" then
      minetest.chat_send_player(user:get_player_name(), "Do not place lava over -5m, that could end really bad!", true)
      return
end
if minetest.is_protected(pos, user:get_player_name()) then
      minetest.record_protection_violation(pos, user:get_player_name())
      return
end


mods/moreblocks/stairsplus.lua wrote:Beginning at line #110
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if minetest.is_protected(above, placer:get_player_name()) then
      minetest.chat_send_player(placer:get_player_name(), "This area is protected. You can not place that node here.", true)
      return itemstack
end


Tested with the "Land Rush Land Claim" mod - works fine.

EDIT8: Forgot the screwdriver..anyway it would be nice, so it's not needed to add those codes on each node...
Last edited by Krock on Sun Feb 16, 2014 17:43, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
CraigyDavi
Member
 
Posts: 565
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio or CraigyDavi
In-game: davisonio or CraigyDavi

by CraigyDavi » Sun Feb 16, 2014 18:15

Thank you Krock :)
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 18 guests

cron