I saw in the commitnotes that this worked with the playerfactions mod, however, when I went to use it, right clicking on the protector produced a fatal crash:
2020-12-24 18:21:44: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): ...e/games/minetest/games/mesecraft/mods/protector/init.lua:176: bad argument #1 to 'next' (table expected, got nil)
2020-12-24 18:21:44: ERROR[Main]: stack traceback:
2020-12-24 18:21:44: ERROR[Main]: [C]: in function 'next'
2020-12-24 18:21:44: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:176: in function 'protector_formspec'
2020-12-24 18:21:44: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:504: in function 'on_rightclick'
2020-12-24 18:21:44: ERROR[Main]: /usr/share/games/minetest/builtin/game/item.lua:426: in function </usr/share/games/minetest/builtin/game/item.lua:419>
2020-12-24 19:25:55: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback node_on_punch(): /usr/share/games/minetest/builtin/game/auth.lua:13: assertion failed!
2020-12-24 19:25:55: ERROR[Main]: stack traceback:
2020-12-24 19:25:55: ERROR[Main]: [C]: in function 'assert'
2020-12-24 19:25:55: ERROR[Main]: /usr/share/games/minetest/builtin/game/auth.lua:13: in function 'get_auth'
2020-12-24 19:25:55: ERROR[Main]: /usr/share/games/minetest/builtin/game/misc.lua:87: in function 'player_exists'
2020-12-24 19:25:55: ERROR[Main]: ...es/minetest/games/mesecraft/mods/playerfactions/init.lua:51: in function 'player_is_in_faction'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:87: in function 'is_member'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:312: in function 'can_dig'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:363: in function 'is_protected'
2020-12-24 19:25:55: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:512: in function <...e/games/minetest/games/mesecraft/mods/protector/init.lua:510>
Last edited by MeseCraft on Fri Dec 25, 2020 01:54, edited 1 time in total.
2020-12-24 19:33:31: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback item_OnPlace(): /usr/share/games/minetest/builtin/game/auth.lua:13: assertion failed!
2020-12-24 19:33:31: ERROR[Main]: stack traceback:
2020-12-24 19:33:31: ERROR[Main]: [C]: in function 'assert'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/game/auth.lua:13: in function 'get_auth'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/game/misc.lua:87: in function 'player_exists'
2020-12-24 19:33:31: ERROR[Main]: ...es/minetest/games/mesecraft/mods/playerfactions/init.lua:51: in function 'player_is_in_faction'
2020-12-24 19:33:31: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:87: in function 'is_member'
2020-12-24 19:33:31: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:312: in function 'can_dig'
2020-12-24 19:33:31: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:363: in function 'is_protected'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/game/item.lua:299: in function 'item_place_node'
2020-12-24 19:33:31: ERROR[Main]: /usr/share/games/minetest/builtin/common/misc_helpers.lua:340: in function </usr/share/games/minetest/builtin/common/misc_helpers.lua:286>
MisterE did most of this, he said I'll try to make an issue in your repo.
We were able to resolve the problems as far as we can tell and its working well now. Ended up with a protector init file as below that is working correctly with playerfactions and protector.
now a conflict with mobs redo
2020-12-24 20:11:40: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback LuaABM::trigger(): ...e/games/minetest/games/mesecraft/mods/protector/init.lua:85: bad argument #1 to 'ipairs' (table expected, got boolean)
2020-12-24 20:11:40: ERROR[Main]: stack traceback:
2020-12-24 20:11:40: ERROR[Main]: [C]: in function 'ipairs'
2020-12-24 20:11:40: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:85: in function 'is_member'
2020-12-24 20:11:40: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:312: in function 'can_dig'
2020-12-24 20:11:40: ERROR[Main]: ...e/games/minetest/games/mesecraft/mods/protector/init.lua:363: in function 'is_protected'
2020-12-24 20:11:40: ERROR[Main]: ...re/games/minetest/games/mesecraft/mods/mobs_redo/api.lua:3935: in function 'spawn_action'
2020-12-24 20:11:40: ERROR[Main]: ...re/games/minetest/games/mesecraft/mods/mobs_redo/api.lua:4015: in function <...re/games/minetest/games/mesecraft/mods/mobs_redo/api.lua:4014>
Being inspired by the areas-based protection, where you can set an area name and have it displayed on the hud, I thought that would be nice to have the same feature in the protector mod too! :)
The use case that gave me this idea is a player that's building beautiful PoIs and he nicely names them too, though the only place those names are displayed are in poorly-visible signs at their entrances.
I think it should easily be feasible by adding a new text field to the protector formspec and adding that field value to the hud too, where it already shows the owner.
The placer tool would also need to copy the value as it does with members when used with sneak pressed.
@hlqkj - Protector Redo already displays the owner's name in the bottom left of the screen using HUD and placing a protector using the tool while holding sneak already copies all of the members across to the new one.
@hlqkj - Protector Redo already displays the owner's name in the bottom left of the screen using HUD and placing a protector using the tool while holding sneak already copies all of the members across to the new one.
I know all this of course, indeed, I wasn't talking about the player name but the "area name", that is an additional text field that players could use to name their places...
Note that this wasn't meant to be a feature request, rather more like an opinion poll :)
Relative to HUD_TEXT =S (Owner: @ 1, NodeOwner) in Hud.lua. For me, it's better with a minimum of information on the screen that I don't need right now. Perhaps it is better to display the HUD_TEXT only if the Protector is in Hotbar?
Last edited by amadin on Tue Apr 20, 2021 08:51, edited 2 times in total.
I have protectors set so that they damage players for trying to break protected areas of other players. I have two players, who get messages about being damaged in random places by protectors of another player. It happens on any protected territory randomly. I saw it with my own eyes. Player gets a message "This area is owned by" with another player name. This player in example below always gets a message about area owned by player name 0bits, for example.
I run a multicraft 2.0.0 server.
when a player gets damaged, it looks like this:
2021-07-06 15:44:08: ACTION[Server]: PC007 damaged by 1 hp at (-3634.16,8.914,129.845)
This isn't a bug, it's the log info in console showing that a player has tried to do something inside a protected area and the damage they received shortly after, you can alter settings in minetest to only show actions instead so it doesn't show everything that happens, and protector redo has a setting to turn off messages.
OK, I will not add a video, since forum does not allow it. I put it on YouTube, access by link only.
It was provided by the second player, Moon_X, who is jumping under their own protector and viewing messages about area being owned by another player and getting damaged.
Stamina mod has it's own sprint included so hbsprint is not required, and as for the issue at hand, it seems that something is checking for minetest.is_protected() for Moon_X but in a totally different area which is owned by PC007 so you have a rogue mod somewhere.