[Mod] Protector Redo [3.2] [protector]

Post Reply
amadin
Member
Posts: 548
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Protector Redo [1.8] [protector]

by amadin » Post

It does not prevent you to use colored glass blocks in a cblocks mod even more bug.

Image

For me the problem with transparent protector logo is not serious.
Attachments
screenshot_20161023_085700.png
(425.97 KiB) Not downloaded yet

auouymous
Member
Posts: 184
Joined: Sun Dec 07, 2014 09:39
GitHub: auouymous
IRC: air
In-game: auouymous

Re: [Mod] Protector Redo [1.8] [protector]

by auouymous » Post

amadin wrote:It does not prevent you to use colored glass blocks in a cblocks mod even more bug. For me the problem with transparent protector logo is not serious.
Not a bug, just a missing feature in minetest. It could easily sort map blocks near to far and draw opaque geometry, then sort them far to near and draw semi-transparent geometry. That solves a lot of alpha rendering issues, and depth peeling (harder) would solve the rest.

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

Re: [Mod] Protector Redo [1.9] [protector]

by TenPlus1 » Post

Updated to version 1.9

- Changed 'protector_pvp_spawn' setting to 'protector_spawn' so that server owners can protect area around static spawnpoint by setting a value above 0.
- Tweaked and tidied code

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

Updated to version 2.0

- Added protector placement tool which lets players stand on a protector, face in a direction and place a new one using protector.radius to protect a larger area a lot more easily :) thanks Shara.

User avatar
firefox
Member
Posts: 1583
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Protector Redo [2.0] [protector]

by firefox » Post

TenPlus1 wrote:Updated to version 2.0

- Added protector placement tool which lets players stand on a protector, face in a direction and place a new one using protector.radius to protect a larger area a lot more easily :) thanks Shara.
woooooooot =(0.0)=

+100
=(^.^)= nyan~

User avatar
iska
Member
Posts: 31
Joined: Thu Apr 23, 2015 17:19
In-game: iska
Location: Finland

Re: [Mod] Protector Redo [2.0] [protector]

by iska » Post

TenPlus1 wrote:Updated to version 2.0

- Added protector placement tool which lets players stand on a protector, face in a direction and place a new one using protector.radius to protect a larger area a lot more easily :) thanks Shara.
Hi Ten!

Just tested the new tool on local server, very impressive, we gonna love it so much, thanks Shara and TenPlus1! :)

Suggestions for improving:
Copy added players from original protection to newly created prots
Add vertical support for people with fly priv (makes sense?)
Maybe add 45 degree angles?
Any chance of adding logo-support?

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

Update:

- Admin commands renamed to /protector_remove and /protector_replace

User avatar
Codesound
Member
Posts: 311
Joined: Thu Jun 09, 2016 14:56

Re: [Mod] Protector Redo [2.0] [protector]

by Codesound » Post

Hi,

sorry for my incompetence
, but I can not understand how to use this mod...
I would use it to protect the spawnpoint of my server and protect specific areas of my level....

- I simply placed the "protection Block" (to protect my area), (image 001);
- Right click on this "protection Block" to add my user name: no one except "username" can break anything in this area... (or not......? image 002);
- If I add another player name on this block, ie "Test 2", also Test 2 can break in this area... is correct?
- to modify the range of this area, I simply modified the "minetest.info"......

............... but certainly all wrong..........
anyone can help me understand how to use this mod?

Thanks for your support

R
Attachments
002.png
(182.85 KiB) Not downloaded yet
001.png
(203.17 KiB) Not downloaded yet

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

Hi Codesound, placing a protector automatically has you as it's owner, so no-one can break or add anything to the area it protects (shown by the purple field when you punch it)... You can right-click the protector and add other players to the list so they can change that area also :)

If you are looking to protect a large spawn area then the mod has a setting you add to minetest.conf (usually for servers) which does just that:

Code: Select all

# set spawn point to 0,10,0
static_spawnpoint = 0,10,0
# protect 100 blocks around spawn
protector_spawn = 100
.. for more information check out the readme.md file:
https://github.com/tenplus1/protector/b ... /README.md

User avatar
Codesound
Member
Posts: 311
Joined: Thu Jun 09, 2016 14:56

Re: [Mod] Protector Redo [2.0] [protector]

by Codesound » Post

Hi,

I'm stupid!!! I try this mod on my server with others 3 players with all permissions.....

it is clear that they can break everything.... Thanks for your support!!!

R

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

If any player has the 'protection_bypass' privelage then yes, protection wont stop them breaking/adding things.

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

Updated:

- Protectors can no longer be moved by mesecon pistons.

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

Re: [Mod] Protector Redo [2.0] [protector]

by ExeterDad » Post

Just putting this out here. I see in past discussion a request for smaller sized pro blocks. I would also like to see this implemented if possible. I'm laying a huge amount of road on a server. These roads are to encourage building in a organized way. And of course for easy access for players. I really would like a block that has a radius that would exactly span the width of my roads so players can build right up to the roads without leaving a "undeveloped" gap that is protected by a oversized pro block. Our roads are seven blocks wide, so would require a radius of three. Having all the pro blocks set at that radius would result in the player having to set way too many pro blocks. Even the default radius of five (11 blocks) is a little small for players to protect properties in my opinion.

I have been working at implementing a custom pro block "road" node. I managed to get it to display properly when punched. But I can't get my mind around the code to work with the standard larger radius and my smaller "road radius". As a result I'm having to rewrite too much of your code and getting myself in deeper then I'm capable of :D

So any help would be appreciated. Whether it's the added feature... or hints of how I can add it myself.

Thanks :)

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

We already have a setting for protection radius which the server/client can reduce to 3 if needed for intricate build protection, failing that a specialised node just for your road with a mini protection routine build in :)

ektor
Member
Posts: 78
Joined: Sat Sep 24, 2016 11:59
IRC: dtarcz
In-game: ektor
Contact:

Re: [Mod] Protector Redo [2.0] [protector]

by ektor » Post

Hi, your work is very much appreciate TenPlus1, and i enjoy playing in Xanadu :)

There is a question I find usefull, but seems you don't answer yet :
deadmenracing wrote:Excellent mod, thank you! Is there an easy way (...) to limit the number of protection blocks a player can put down? I'm seeing it overused a bit.
Can we configure that in the "minetest.conf" file? Or something to change in the code... and if yes, where?
Vive Minetest!

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

I could look into that as a future feature maybe.

ektor
Member
Posts: 78
Joined: Sat Sep 24, 2016 11:59
IRC: dtarcz
In-game: ektor
Contact:

Re: [Mod] Protector Redo [2.0] [protector]

by ektor » Post

OK, thanks.
Vive Minetest!

User avatar
Codesound
Member
Posts: 311
Joined: Thu Jun 09, 2016 14:56

Re: [Mod] Protector Redo [2.0] [protector]

by Codesound » Post

Hi,

I really appreciate this mod, and I would have a request to improve it:

it is possible to add the possibility to set for each protector the size of the area that it protects?
In its menu that appears, you could add the ability to enter values ​​that correspond to the XYZ coordinates of protection for each block?

it's just a question....
many and many thanks for all!

R

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

I could but checks like that would slow things down... Protector Redo does have a setting for the minetest.conf file however to set protected area size: protector_radius = 5

To protect specific areas of different sizes you could always try the Areas mod.

User avatar
poikilos
Member
Posts: 64
Joined: Thu Feb 18, 2016 13:45
GitHub: poikilos
In-game: Abiyahh

Re: [Mod] Protector Redo [2.0] [protector]

by poikilos » Post

Hello, I looked into this crash but the attached log doesn't help me pinpoint why it crashes. It happens when killing yourself (and possibly other death) by digging in a protected area with latest git version of Minetest server (and windows git build). It seems to be infinite recursion (same function called over and over, lua memory usage approaching 1GB).

NOTE: I made one change to your code to prevent a different crash. Please consider making this change permanent:
return protector.can_dig(1, pos, player:get_player_name(), true, 1)
to
return player and protector.can_dig(1, pos, player:get_player_name(), true, 1) or false
The change above fixes a nil player crash, but I'm not sure if it has other consequences or is related to the problem below.
I was not able to fix the crash below nor understand the cause using the debug output:


The debug output below is from a sitation in multiplayer that I couldn't replicate exactly (player names hidden for privacy):
(parts in between . . . lines were repeated many times)
+ Spoiler
I generated the debug output below by killing myself by punching a protected dirt block over and over until I died (similar to above, but [only sometimes] involves may_replace])
(parts in between . . . lines were repeated many times--stack trace with set_hp error had may set_hp errors per stack trace, until the last stack trace had 1)
+ Spoiler

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

Thanks expertmm, change has been applied to git code.

User avatar
poikilos
Member
Posts: 64
Joined: Thu Feb 18, 2016 13:45
GitHub: poikilos
In-game: Abiyahh

Re: [Mod] Protector Redo [2.0] [protector]

by poikilos » Post

Ok I seemed to have fixed the set_hp infinite recursion bug by adding the following checks before continuing the not protector.can_dig case in the is_protected function (I'm not actually sure why it would be infinite recursion otherwise). I came upon this solution because one of the errors was regarding set_hp and below makes sure digger is really a player before we process protector violations for digger (make sure you add "end" directly before return true as in the code below, so that protected status will return even if digger is not a player):

Code: Select all

	-- is area protected against digger?
	if not protector.can_dig(protector.radius, pos, digger, false, 1) then
		local player = minetest.get_player_by_name(digger)
		if player and player:is_player() and player:get_hp() > 0 then -- ADDED THIS LINE
			-- hurt player if protection violated

                        ------- process all of those violations (no change to this part of code except indent) -------
		end  -- ADDED THIS LINE
		return true
	end

	-- otherwise can dig or place

As you can see, only two lines of code were added in the code above:

Code: Select all

if player and player:is_player() and player:get_hp() > 0 then
and

Code: Select all

end
(the "end" before "return true")
--the other code is just shown for placement.

And here is a debug version (You can safely insert this debug code before the "if player" line above in order to show some helpful info):
+ Spoiler
You can also remove all of the "and player" checks now (unless using the debug version without the real fix afterward which wraps the violation processing) and move the "then" to the previous line, since player is checked before any violations are processed.

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

expertmm: Player check added with some changes... I would recommend joining github so you can post issues and pull requests there :)

User avatar
Hybrid Dog
Member
Posts: 2768
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Protector Redo [2.0] [protector]

by Hybrid Dog » Post

Please save the date, accuracy in seconds, to the meta when someone places a protector. It allows admins to remove old protector nodes of specific people.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

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

Re: [Mod] Protector Redo [2.0] [protector]

by TenPlus1 » Post

We already have a /protector_remove command to handle removal of player protectors.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Nathan.S and 8 guests