AliasAlreadyTaken reports: If a jailed person logs out, t ... #3048

Closed
opened 2022-11-15 19:55:39 +00:00 by yourland-report · 12 comments

AliasAlreadyTaken reports a bug:

If a jailed person logs out, they are not moved into the jail chat after they log in again

Player position:

{
	y = 54.5,
	z = -3032.0080566406,
	x = -1020.2080078125
}

Player look:

{
	y = -0.48923021554947,
	z = -0.60977935791016,
	x = -0.62355661392212
}

Player information:

{
	formspec_version = 6,
	lang_code = "",
	min_rtt = 0.017000000923872,
	avg_rtt = 0.018999999389052,
	protocol_version = 41,
	max_jitter = 3.3940000534058,
	avg_jitter = 0.0010000001639128,
	connection_uptime = 58581,
	serialization_version = 29,
	patch = 0,
	max_rtt = 3.4179999828339,
	major = 5,
	minor = 7,
	state = "Active",
	version_string = "5.7.0-dev-1a045da0d",
	min_jitter = 0,
	ip_version = 6
}

Player meta:

{
	fields = {
		hud_state = "on",
		repellant = "0",
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}",
		["signslib:pos"] = "(2041,17,1149)",
		["arena_lib_editor.players_number"] = "0",
		["arena_lib_editor.spawner_ID"] = "0",
		partychat = "party",
		xp_redo_hud_color = "0xFFFF00",
		arenalib_infobox_arenaID = "0",
		["3d_armor_inventory"] = "return {\"\", \"\", \"\", \"\", \"\", \"\"}",
		lagometer = "1",
		punch_count = "62049",
		["ocean_build.last_warning"] = "1.659e+09",
		inflicted_damage = "2533854",
		["ocean_build.ocean_built"] = "10",
		yl_commons_player_joined = "1668483566",
		team = "STAFF",
		yl_commons_thankyou = "633",
		["arena_lib_editor.team_ID"] = "0",
		died = "1582",
		crafted = "4409",
		xp = "0",
		["stamina:level"] = "0",
		placed_nodes = "177293",
		["stamina:poisoned"] = "no",
		yl_church = "return {[\"last_death\"] = {[\"x\"] = -16080, [\"y\"] = -9915, [\"z\"] = -15812}, [\"last_death_portal\"] = 1663123370, [\"last_heal\"] = 1622459682}",
		["stamina:exhaustion"] = "94.5",
		played_time = "65884048",
		bitten = "0",
		digged_nodes = "135835",
		["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)",
		yl_audio_state = "off",
		["ethereal:fly_timer"] = "-99",
		szutil_watch = "return {}"
	}
}

Log identifier


[MOD] yl_report log identifier = iqTdZdOXbG5BTGGPQPmgW24rTuoc7zpf

Profiler save:

profile-20221115T195539.json_prettyEE

Status:

# Server: version: 5.6.1-yl | game: Minetest Game | uptime: 18h 52min 3s | max lag: 3.21s | clients (29/42): AliasAlreadyTaken, Antrica, Apocralypse, Bailiff, BibaBoba, Boot, Crystal1976, ecki, Elise_, ffelder, flux, Frisded, gogo77, jackofthebean000, JeCel, leon1, mad-dog86, Miri, Murmel, Parrish, Queenfire234312, rabenkind, Service, shanish, sherkhan30452, Tim_32, TobiasGaming, Tute, Unelias

Teleport command:

/teleport xyz -1020 55 -3032

Compass command:

/give_compass Construction iqTdZdOXbG5BTGGPQPmgW24rTuoc7zpf D2691E -1020 55 -3032
AliasAlreadyTaken reports a bug: > If a jailed person logs out, they are not moved into the jail chat after they log in again Player position: ``` { y = 54.5, z = -3032.0080566406, x = -1020.2080078125 } ``` Player look: ``` { y = -0.48923021554947, z = -0.60977935791016, x = -0.62355661392212 } ``` Player information: ``` { formspec_version = 6, lang_code = "", min_rtt = 0.017000000923872, avg_rtt = 0.018999999389052, protocol_version = 41, max_jitter = 3.3940000534058, avg_jitter = 0.0010000001639128, connection_uptime = 58581, serialization_version = 29, patch = 0, max_rtt = 3.4179999828339, major = 5, minor = 7, state = "Active", version_string = "5.7.0-dev-1a045da0d", min_jitter = 0, ip_version = 6 } ``` Player meta: ``` { fields = { hud_state = "on", repellant = "0", ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}", ["signslib:pos"] = "(2041,17,1149)", ["arena_lib_editor.players_number"] = "0", ["arena_lib_editor.spawner_ID"] = "0", partychat = "party", xp_redo_hud_color = "0xFFFF00", arenalib_infobox_arenaID = "0", ["3d_armor_inventory"] = "return {\"\", \"\", \"\", \"\", \"\", \"\"}", lagometer = "1", punch_count = "62049", ["ocean_build.last_warning"] = "1.659e+09", inflicted_damage = "2533854", ["ocean_build.ocean_built"] = "10", yl_commons_player_joined = "1668483566", team = "STAFF", yl_commons_thankyou = "633", ["arena_lib_editor.team_ID"] = "0", died = "1582", crafted = "4409", xp = "0", ["stamina:level"] = "0", placed_nodes = "177293", ["stamina:poisoned"] = "no", yl_church = "return {[\"last_death\"] = {[\"x\"] = -16080, [\"y\"] = -9915, [\"z\"] = -15812}, [\"last_death_portal\"] = 1663123370, [\"last_heal\"] = 1622459682}", ["stamina:exhaustion"] = "94.5", played_time = "65884048", bitten = "0", digged_nodes = "135835", ["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)", yl_audio_state = "off", ["ethereal:fly_timer"] = "-99", szutil_watch = "return {}" } } ``` Log identifier ``` [MOD] yl_report log identifier = iqTdZdOXbG5BTGGPQPmgW24rTuoc7zpf ``` Profiler save: ``` profile-20221115T195539.json_prettyEE ``` Status: ``` # Server: version: 5.6.1-yl | game: Minetest Game | uptime: 18h 52min 3s | max lag: 3.21s | clients (29/42): AliasAlreadyTaken, Antrica, Apocralypse, Bailiff, BibaBoba, Boot, Crystal1976, ecki, Elise_, ffelder, flux, Frisded, gogo77, jackofthebean000, JeCel, leon1, mad-dog86, Miri, Murmel, Parrish, Queenfire234312, rabenkind, Service, shanish, sherkhan30452, Tim_32, TobiasGaming, Tute, Unelias ``` Teleport command: ``` /teleport xyz -1020 55 -3032 ``` Compass command: ``` /give_compass Construction iqTdZdOXbG5BTGGPQPmgW24rTuoc7zpf D2691E -1020 55 -3032 ```
AliasAlreadyTaken was assigned by yourland-report 2022-11-15 19:55:39 +00:00
AliasAlreadyTaken added the
1. kind/bug
label 2022-11-15 20:32:57 +00:00
flux added the
4. step/ready to QA test
label 2022-11-15 20:51:24 +00:00
Member

fixed in 1ed10bc9dc

fixed in https://gitea.your-land.de/your-land/yl_commons/commit/1ed10bc9dcb444d69fa56cc9fdbd888898d63c03
AliasAlreadyTaken added this to the 1.1.117 milestone 2022-11-16 03:43:39 +00:00

Upon login:

2023-01-18 10:03:25: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback on_joinplayer(): ...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:49: bad argument #1 to 'get_player_privs' (string expected, got userdata)
2023-01-18 10:03:25: ERROR[Main]: stack traceback:
2023-01-18 10:03:25: ERROR[Main]: 	[C]: in function 'get_player_privs'
2023-01-18 10:03:25: ERROR[Main]: 	...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:49: in function 'jail'
2023-01-18 10:03:25: ERROR[Main]: 	...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:173: in function 'func'
2023-01-18 10:03:25: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-01-18 10:03:25: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:431:
Upon login: ``` 2023-01-18 10:03:25: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback on_joinplayer(): ...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:49: bad argument #1 to 'get_player_privs' (string expected, got userdata) 2023-01-18 10:03:25: ERROR[Main]: stack traceback: 2023-01-18 10:03:25: ERROR[Main]: [C]: in function 'get_player_privs' 2023-01-18 10:03:25: ERROR[Main]: ...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:49: in function 'jail' 2023-01-18 10:03:25: ERROR[Main]: ...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:173: in function 'func' 2023-01-18 10:03:25: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100> 2023-01-18 10:03:25: ERROR[Main]: .../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:431: ```

playername instead of playerobject problem ;)

Fixed in 839945c653

playername instead of playerobject problem ;) Fixed in https://gitea.your-land.de/your-land/yl_commons/commit/839945c6535cb5e9231c3bb407727b66ee479fb0
AliasAlreadyTaken added the
ugh/QA OK
label 2023-01-18 10:11:31 +00:00
AliasAlreadyTaken added
ugh/QA NOK
and removed
ugh/QA OK
labels 2023-01-18 13:22:26 +00:00

Still not fully fixed. Now if a jailed person logs out and then logs in again, they are sent into the jail channel: OK

But now when they are unjailed, they do not get their privs back. They stay invincible and jailed

Still not fully fixed. Now if a jailed person logs out and then logs in again, they are sent into the jail channel: OK But now when they are unjailed, they do not get their privs back. They stay invincible and jailed
Member

Still not fully fixed. Now if a jailed person logs out and then logs in again, they are sent into the jail channel: OK

But now when they are unjailed, they do not get their privs back. They stay invincible and jailed

there were a couple checks that were missing. i've reworked it a bit and tested that privs are kept.

i do think "jailed" shouldn't be a "privilege", it's basically the opposite of one :) but that's another topic.

> Still not fully fixed. Now if a jailed person logs out and then logs in again, they are sent into the jail channel: OK > > But now when they are unjailed, they do not get their privs back. They stay invincible and jailed there were a couple checks that were missing. i've reworked it a bit and tested that privs are kept. i do think "jailed" shouldn't be a "privilege", it's basically the opposite of one :) but that's another topic.

i do think "jailed" shouldn't be a "privilege"

Unfortunately true. /grantme all -> boom, jailed.

From a datastructure point of view, where should such a metadatum reside? Clearly with playermeta.

Unfortunately playermeta cannot be accessed from the outside or when a player is not logged in.

What CAN be accessed while a player is not logged in? mod storage or some file of our own.

We must not store any playernames in modstorage, the way it is layed out makes it pretty heavy and unsuitable to access a player-metadatum in there. Worst example. party mod, it stores ALL playernames in modstorage.

We cannot outsource a lot of metadata as privs, this will soon get pretty cluttered, especially when we want to store more than a boolean decision (is jailed/ is not jailed)

That leaves us with some file of our own, read yl_settings. Until then, we'll need to abuse the privs.

The "correct" solution to this problem would be to make the core devs allow access to playermeta from the outside, like privs are. yl_settings is only a means to go around the shortcomings of the engine at this point.

> i do think "jailed" shouldn't be a "privilege" Unfortunately true. /grantme all -> boom, jailed. From a datastructure point of view, where should such a metadatum reside? Clearly with playermeta. Unfortunately playermeta cannot be accessed from the outside or when a player is not logged in. What CAN be accessed while a player is not logged in? mod storage or some file of our own. We must not store any playernames in modstorage, the way it is layed out makes it pretty heavy and unsuitable to access a player-metadatum in there. Worst example. party mod, it stores ALL playernames in modstorage. We cannot outsource a lot of metadata as privs, this will soon get pretty cluttered, especially when we want to store more than a boolean decision (is jailed/ is not jailed) That leaves us with some file of our own, read yl_settings. Until then, we'll need to abuse the privs. The "correct" solution to this problem would be to make the core devs allow access to playermeta from the outside, like privs are. yl_settings is only a means to go around the shortcomings of the engine at this point.
Member

Unfortunately true. /grantme all -> boom, jailed.

i tried to write some code that prevented staff from granting themselves the "jailed" priv, but it resulted in a stack overflow no matter what i did, and i'm not sure why, but making it not a "privilege" is probably the better solution.

The "correct" solution to this problem would be to make the core devs allow access to playermeta from the outside, like privs are. yl_settings is only a means to go around the shortcomings of the engine at this point.

yeah, minetest.get_player_meta(player_or_name) should be a thing. is there an issue about that?

> Unfortunately true. /grantme all -> boom, jailed. i tried to write some code that prevented staff from granting themselves the "jailed" priv, but it resulted in a stack overflow no matter what i did, and i'm not sure why, but making it not a "privilege" is probably the better solution. > The "correct" solution to this problem would be to make the core devs allow access to playermeta from the outside, like privs are. yl_settings is only a means to go around the shortcomings of the engine at this point. yeah, `minetest.get_player_meta(player_or_name)` should be a thing. is there an issue about that?
https://github.com/minetest/minetest/pull/9164 and https://github.com/minetest/minetest/pull/9177 and https://github.com/minetest/minetest/pull/4155

When a jailed player leaves the server:

2023-01-19 06:24:25: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback on_joinplayer(): .../5.6.1/Minetest_test/bin/../mods/smart_chat/cmd_move.lua:39: bad argument #1 to 'get_player_by_name' (string expected, got userdata)
2023-01-19 06:24:25: ERROR[Main]: stack traceback:
2023-01-19 06:24:25: ERROR[Main]: 	[C]: in function 'get_player_by_name'
2023-01-19 06:24:25: ERROR[Main]: 	.../5.6.1/Minetest_test/bin/../mods/smart_chat/cmd_move.lua:39: in function <.../5.6.1/Minetest_test/bin/../mods/smart_chat/cmd_move.lua:18>
2023-01-19 06:24:25: ERROR[Main]: 	/home/mt/5.6.1/Minetest_test/bin/../mods/smart_chat/lib.lua:33: in function 'check'
2023-01-19 06:24:25: ERROR[Main]: 	...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:185: in function 'func'
2023-01-19 06:24:25: ERROR[Main]: 	...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
2023-01-19 06:24:25: ERROR[Main]: 	.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:417>

Btw, should we post followup issues like this in a new issue?

When a jailed player leaves the server: ``` 2023-01-19 06:24:25: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback on_joinplayer(): .../5.6.1/Minetest_test/bin/../mods/smart_chat/cmd_move.lua:39: bad argument #1 to 'get_player_by_name' (string expected, got userdata) 2023-01-19 06:24:25: ERROR[Main]: stack traceback: 2023-01-19 06:24:25: ERROR[Main]: [C]: in function 'get_player_by_name' 2023-01-19 06:24:25: ERROR[Main]: .../5.6.1/Minetest_test/bin/../mods/smart_chat/cmd_move.lua:39: in function <.../5.6.1/Minetest_test/bin/../mods/smart_chat/cmd_move.lua:18> 2023-01-19 06:24:25: ERROR[Main]: /home/mt/5.6.1/Minetest_test/bin/../mods/smart_chat/lib.lua:33: in function 'check' 2023-01-19 06:24:25: ERROR[Main]: ...netest_test/bin/../mods/yl_commons/chatcommands/jail.lua:185: in function 'func' 2023-01-19 06:24:25: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100> 2023-01-19 06:24:25: ERROR[Main]: .../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:431: in function <.../mt/5.6.1/Minetest_test/bin/../builtin/game/register.lua:417> ``` Btw, should we post followup issues like this in a new issue?
Member

Btw, should we post followup issues like this in a new issue?

this is due to a botched fix, so it should stay here. i never encountered this because there's no "Service" account on my test server w/ the right privilege, so smart_chat gave up earlier.

fixed it again: 2421c3a8c0

> Btw, should we post followup issues like this in a new issue? this is due to a botched fix, so it should stay here. i never encountered this because there's no "Service" account on my test server w/ the right privilege, so smart_chat gave up earlier. fixed it again: https://gitea.your-land.de/your-land/yl_commons/commit/2421c3a8c0ba03bea5ab6da31c07d935f8c094e2

This works as expected now :)

Cooool!

This works as expected now :) Cooool!
AliasAlreadyTaken added
ugh/QA OK
and removed
ugh/QA NOK
labels 2023-01-19 22:47:42 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-01-25 18:58:08 +00:00
AliasAlreadyTaken was unassigned by flux 2023-01-25 18:58:10 +00:00
Member

this is live

this is live
flux closed this issue 2023-01-25 18:58:19 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#3048
No description provided.