[Mod] Protector Redo [3.2] [protector]

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

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

by amadin » Post

Did any way to disable pvp only for player owned protected areas, but not for all protected areas in the world?

User avatar
maikerumine
Member
Posts: 1387
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

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

by maikerumine » Post

Hi Ten,
mods\protector\init.lua:218: attempt to index local 'player' (a nil value)
I noticed a bug with the protector when tnt or a mob explosion occurs while set damage and drop tool is used.
The protector call: "is_protected" is asking for a player name where an entity such as tnt isn't a player therefore the game crashes.

Code: Select all

2016-01-05 22:29:19: ERROR[Main]: UNRECOVERABLE error occurred. Stopping server. Please fix the following error:
2016-01-05 22:29:19: ERROR[Main]: Lua: Runtime error from mod '' in callback luaentity_Step(): ...ER\bin\..\games\extreme_survival\mods\protector\init.lua:218: attempt to index local 'player' (a nil value)
2016-01-05 22:29:19: ERROR[Main]: stack traceback:
2016-01-05 22:29:19: ERROR[Main]: 	...ER\bin\..\games\extreme_survival\mods\protector\init.lua:218: in function 'is_protected'
2016-01-05 22:29:19: ERROR[Main]: 	...SERVER\bin\..\games\extreme_survival\mods\esmobs/api.lua:768: in function <...SERVER\bin\..\games\extreme_survival\mods\esmobs/api.lua:255>

In thread 34b0:
/home/stefan/mt-build/build/minetest/minetest/src/server.cpp:505: step: A fatal error occurred: Lua: Runtime error from mod '' in callback luaentity_Step(): ...ER\bin\..\games\extreme_survival\mods\protector\init.lua:218: attempt to index local 'player' (a nil value)
stack traceback:
	...ER\bin\..\games\extreme_survival\mods\protector\init.lua:218: in function 'is_protected'
	...SERVER\bin\..\games\extreme_survival\mods\esmobs/api.lua:768: in function <...SERVER\bin\..\games\extreme_survival\mods\esmobs/api.lua:255>
Extreme Survival Minetest-->viewtopic.php?f=10&t=12959

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

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

by TenPlus1 » Post

This bug has been fixed already, please download latest version of mod from github page :)

User avatar
maikerumine
Member
Posts: 1387
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

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

by maikerumine » Post

TenPlus1 wrote:This bug has been fixed already, please download latest version of mod from github page :)
THANK YOU!!! :-) This help save me sooo much grief chasing around my tail. lol
Extreme Survival Minetest-->viewtopic.php?f=10&t=12959

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

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

by TenPlus1 » Post

Quick update:

- Tweaked code to be less buggy for violation item drop.
- A few performance tweaks.

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

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

by amadin » Post

.
Last edited by amadin on Wed Dec 18, 2019 20:05, edited 1 time in total.

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

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

by TenPlus1 » Post

Quick update:

- Added on_blast to stop tnt destroying protection.
- Fixed protector overlap bug.

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

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

by amadin » Post

.
Last edited by amadin on Wed Dec 18, 2019 20:02, edited 1 time in total.

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

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

by TenPlus1 » Post

Just tested protection and a player NOT on the protector list or that has 'delprotect' priv cannot open a protected door, chest or protector itself. Will keep looking as to why this happened.

Updated to version 1.7:

- Added an edited version of the old WTFPL doors mod to fix protected doors.
- Added protected trapdoors (wood and steel) (trapdoor + copper ingot = protected)

User avatar
SaKeL
Member
Posts: 653
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

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

by SaKeL » Post

server is crashing

Code: Select all

2016-02-14 00:13:02: ERROR[main]: ========== ERROR FROM LUA ===========
2016-02-14 00:13:02: ERROR[main]: Failed to load and run script from 
2016-02-14 00:13:02: ERROR[main]: /root/.minetest/mods/protector/init.lua:
2016-02-14 00:13:02: ERROR[main]: /root/.minetest/mods/protector/doors_chest.lua:45: attempt to call field 'register_door' (a nil value)
2016-02-14 00:13:02: ERROR[main]: stack traceback:
2016-02-14 00:13:02: ERROR[main]: 	/root/.minetest/mods/protector/doors_chest.lua:45: in main chunk
2016-02-14 00:13:02: ERROR[main]: 	[C]: in function 'dofile'
2016-02-14 00:13:02: ERROR[main]: 	/root/.minetest/mods/protector/init.lua:532: in main chunk
2016-02-14 00:13:02: ERROR[main]: ======= END OF ERROR FROM LUA ========
2016-02-14 00:13:02: ERROR[main]: Server: Failed to load and run /root/.minetest/mods/protector/init.lua
UPDATE
Never mind pulled the repo and now protector mod is working, but mydoors mod is broken...still looking for the 'register_door' variable

User avatar
SaKeL
Member
Posts: 653
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

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

by SaKeL » Post

This took me a while, but it's not related to this Mod... it's the new "mesh" doors in minetest_game, had to revert all the new changes related to the new mesh doors...

https://github.com/minetest/minetest_ga ... its/master

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

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

by TenPlus1 » Post

I had to include a basic version of the old doors mod inside Protector Redo to fix all of these errors with the new doors mod... Works now but I can only imagine other mods with same problems.

User avatar
SaKeL
Member
Posts: 653
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

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

by SaKeL » Post

yes there should be some fallback for all the mods :/ i have mydoors and messecon mod complaining about the same error.

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

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

by amadin » Post

.
Last edited by amadin on Wed Dec 18, 2019 20:02, edited 1 time in total.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

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

by Don » Post

I encluded the old doors mod in mydoors as well. I do believe that someone is working on a fix for this.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

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

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

by TenPlus1 » Post

The latest daily build has backwards compatibility for old doors now it seems, will try it soon :)

Update: Door group removed from protected doors so that x-decor mod cannot open them and cause errors.

Rihu
New member
Posts: 4
Joined: Wed Mar 16, 2016 21:19
In-game: Rihu

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

by Rihu » Post

I have this problem with this mod,
2016-03-16 22:17:04: ERROR[main]: Error from Lua:
2016-03-16 22:17:04: ERROR[main]: /home/rihu/.minetest/mods/protectormaster/init.lua:3: '<name>' expected near '='
And idon't know how to solve it!

KCoombes
Member
Posts: 412
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

Rihu wrote:I have this problem with this mod,
2016-03-16 22:17:04: ERROR[main]: Error from Lua:
2016-03-16 22:17:04: ERROR[main]: /home/rihu/.minetest/mods/protectormaster/init.lua:3: '<name>' expected near '='
And idon't know how to solve it!

rename your folder without "master".....

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

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

by poikilos » Post

Digger can still get inside block before remade. This can be prevented by walls that are 2-thick usually, but roof is still too easy to get further inside one block at a time (3-thick roof failed). Please add the following under the "if not protector.can_dig..." condition:

Code: Select all

		--prevent digger from getting inside broken roof block before recreated:
		if player then
			local player_pos = player:getpos()
			local push_distance = 1.0
			local push_x = 0.0
			local push_y = 0.0
			local push_z = 0.0

			if player_pos.y > pos.y then
				push_y = push_distance
				--do not push other way or player will probably go under ground
			end

			player:setpos({x=player_pos.x+push_x, y=player_pos.y+push_y, z=player_pos.z+push_z})
		end

I am not sure how to get the protector position, otherwise I would also set push_x and push_z. If you are able, please implement pushing player away (if i just set where player_pos < pos or player_pos > pos , the player can hit a block farther from protector and be teleported further and further into wall of house

Code: Select all

			--don't use this code (teleports player further into wall toward protector if hits block further from protector that is still protected)
			if math.floor(player_pos.x+.5) > math.floor(pos.x+.5) then
				push_x = push_distance
			elseif math.floor(player_pos.x+.5) < math.floor(pos.x+.5) then
				push_x = push_distance * -1.0
			end

)

Also there is an item duplication bug when dropping something in a protected area only sometimes (but large percentage of time), so may be lag-related (please account for lag in protector.drop condition somehow).

Also, anyone can access a chest in a protected area (even locked chest seems to fail somehow).

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

by Hybrid Dog » Post

auouymous wrote:I was aware of LBMs, on_construct and on_destruct, but what about removing the protectors from the cache/octree when the mapblock is unloaded?
You can use so called weak tables.

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

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

...

by amadin » Post

...

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

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

by TenPlus1 » Post

Updated to 1.8

- Added 'protector_flip' to minetest.conf settings which when true stops any player who digs inside a protected area by flipping them around to face the opposite direction, thus stopping them using lag to grief into someone else's build.

User avatar
Nathan.S
Member
Posts: 1034
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

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

by Nathan.S » Post

TenPlus1 wrote:Updated to 1.8

- Added 'protector_flip' to minetest.conf settings which when true stops any player who digs inside a protected area by flipping them around to face the opposite direction, thus stopping them using lag to grief into someone else's build.
ha, that is genius, I can just see some player trying to grief into another players build getting super frustrated at this. Stellar idea.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

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

by Ivà » Post

TenPlus1 wrote:... Added 'protector_flip' to minetest.conf settings which when true stops any player who digs inside a protected area by flipping them around to face the opposite direction, thus stopping them using lag to grief into someone else's build.
+1
Good idea TenPlus1.

User avatar
Fixer
Member
Posts: 898
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

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

by Fixer » Post

Please add info about protector settings in README.

P.S. Tested this flip feature, it is genius idea! Trying to move in while pressing W will make you move in opposite direction.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests