AliasAlreadyTaken reports: Overwrite minetest.show_formsp ... #4628

Open
opened 2023-05-29 23:35:42 +00:00 by yourland-report · 6 comments

AliasAlreadyTaken reports a bug:

Overwrite minetest.show_formspec, minetest.close_formspec and minetest.register_on_player_receive_fields to cache whether and which formspec is open

Player position:

{
	x = 1979.3000488281,
	y = 18,
	z = 1174.3499755859
}

Player look:

{
	x = 0.99771112203598,
	y = -0.064532309770584,
	z = -0.020202275365591
}

Player information:

{
	min_rtt = 0.017000000923872,
	avg_rtt = 0.01799999922514,
	min_jitter = 0,
	max_jitter = 0.22400000691414,
	avg_jitter = 0.0010000001639128,
	connection_uptime = 1767,
	serialization_version = 29,
	patch = 0,
	version_string = "5.8.0-yl_dev-180ec92ef",
	formspec_version = 6,
	lang_code = "de",
	state = "Active",
	minor = 8,
	max_rtt = 0.24300000071526,
	protocol_version = 41,
	major = 5,
	ip_version = 6
}

Player meta:

{
	fields = {
		partychat = "party",
		xp = "0",
		lagometer = "1",
		["petz:werewolf_clan_idx"] = "4",
		["3d_armor_inventory"] = "return {\"3d_armor:boots_crystal\", \"\", \"\", \"\", \"\", \"\"}",
		["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)",
		bitten = "0",
		punch_count = "63850",
		inflicted_damage = "2871918",
		hud_state = "on",
		["stamina:level"] = "0",
		yl_church = "return {[\"last_death\"] = {[\"z\"] = 1710, [\"x\"] = 2032, [\"y\"] = 34}, [\"last_death_portal\"] = 1683839371, [\"last_heal\"] = 1683837139}",
		arenalib_infobox_arenaID = "0",
		["ocean_build.last_warning"] = "1.67421e+09",
		["ocean_build.forbidden"] = "true",
		["ocean_build.ocean_built"] = "12",
		["arena_lib_editor.team_ID"] = "0",
		["arena_lib_editor.spawner_ID"] = "0",
		["stamina:poisoned"] = "no",
		played_time = "82024977",
		["stamina:exhaustion"] = "37.5",
		["arena_lib_editor.players_number"] = "0",
		["ethereal:fly_timer"] = "-99",
		["petz:werewolf"] = "0",
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}",
		["petz:lycanthropy"] = "0",
		team = "STAFF",
		xp_redo_hud_color = "0xFFFF00",
		digged_nodes = "139956",
		placed_nodes = "180495",
		died = "1590",
		crafted = "4776",
		repellant = "0",
		yl_audio_state = "off",
		yl_commons_player_joined = "1685401582",
		["petz:werewolf_vignette_id"] = "19",
		arenalib_watchID = "0",
		szutil_watch = "return {}",
		["signslib:pos"] = "(2570,44,436)",
		["petz:old_override_table"] = "return {[\"speed\"] = 1, [\"new_move\"] = true, [\"sneak_glitch\"] = false, [\"gravity\"] = 1, [\"jump\"] = 1, [\"sneak\"] = true}",
		yl_commons_thankyou = "1028"
	}
}

Log identifier


[MOD] yl_report log identifier = UIIPUtX15oUiEzMgow75ZQC83TNLHsUd

Profiler save:

profile-20230529T233542.json_prettyEE

Status:

# Server: version: 5.6.1-yl | game: Minetest Game | uptime: 9h 59min 48s | max lag: 0.43s | clients (22/52): AliasAlreadyTaken, Antics, APercy, Azelf, Bailiff, Buzz, crankyape, Diaeresis, Dirac, flux, FullmetalBOI, jackofthebean000, MysticalPlayz, Naan, Nodes, Oakenshield, Oblivion12, sad_girl, Service, shanish2, Supercheese, whymebob

Teleport command:

/teleport xyz 1979 18 1174

Compass command:

/give_compass Construction UIIPUtX15oUiEzMgow75ZQC83TNLHsUd D2691E 1979 18 1174
AliasAlreadyTaken reports a bug: > Overwrite minetest.show_formspec, minetest.close_formspec and minetest.register_on_player_receive_fields to cache whether and which formspec is open Player position: ``` { x = 1979.3000488281, y = 18, z = 1174.3499755859 } ``` Player look: ``` { x = 0.99771112203598, y = -0.064532309770584, z = -0.020202275365591 } ``` Player information: ``` { min_rtt = 0.017000000923872, avg_rtt = 0.01799999922514, min_jitter = 0, max_jitter = 0.22400000691414, avg_jitter = 0.0010000001639128, connection_uptime = 1767, serialization_version = 29, patch = 0, version_string = "5.8.0-yl_dev-180ec92ef", formspec_version = 6, lang_code = "de", state = "Active", minor = 8, max_rtt = 0.24300000071526, protocol_version = 41, major = 5, ip_version = 6 } ``` Player meta: ``` { fields = { partychat = "party", xp = "0", lagometer = "1", ["petz:werewolf_clan_idx"] = "4", ["3d_armor_inventory"] = "return {\"3d_armor:boots_crystal\", \"\", \"\", \"\", \"\", \"\"}", ["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)", bitten = "0", punch_count = "63850", inflicted_damage = "2871918", hud_state = "on", ["stamina:level"] = "0", yl_church = "return {[\"last_death\"] = {[\"z\"] = 1710, [\"x\"] = 2032, [\"y\"] = 34}, [\"last_death_portal\"] = 1683839371, [\"last_heal\"] = 1683837139}", arenalib_infobox_arenaID = "0", ["ocean_build.last_warning"] = "1.67421e+09", ["ocean_build.forbidden"] = "true", ["ocean_build.ocean_built"] = "12", ["arena_lib_editor.team_ID"] = "0", ["arena_lib_editor.spawner_ID"] = "0", ["stamina:poisoned"] = "no", played_time = "82024977", ["stamina:exhaustion"] = "37.5", ["arena_lib_editor.players_number"] = "0", ["ethereal:fly_timer"] = "-99", ["petz:werewolf"] = "0", ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}", ["petz:lycanthropy"] = "0", team = "STAFF", xp_redo_hud_color = "0xFFFF00", digged_nodes = "139956", placed_nodes = "180495", died = "1590", crafted = "4776", repellant = "0", yl_audio_state = "off", yl_commons_player_joined = "1685401582", ["petz:werewolf_vignette_id"] = "19", arenalib_watchID = "0", szutil_watch = "return {}", ["signslib:pos"] = "(2570,44,436)", ["petz:old_override_table"] = "return {[\"speed\"] = 1, [\"new_move\"] = true, [\"sneak_glitch\"] = false, [\"gravity\"] = 1, [\"jump\"] = 1, [\"sneak\"] = true}", yl_commons_thankyou = "1028" } } ``` Log identifier ``` [MOD] yl_report log identifier = UIIPUtX15oUiEzMgow75ZQC83TNLHsUd ``` Profiler save: ``` profile-20230529T233542.json_prettyEE ``` Status: ``` # Server: version: 5.6.1-yl | game: Minetest Game | uptime: 9h 59min 48s | max lag: 0.43s | clients (22/52): AliasAlreadyTaken, Antics, APercy, Azelf, Bailiff, Buzz, crankyape, Diaeresis, Dirac, flux, FullmetalBOI, jackofthebean000, MysticalPlayz, Naan, Nodes, Oakenshield, Oblivion12, sad_girl, Service, shanish2, Supercheese, whymebob ``` Teleport command: ``` /teleport xyz 1979 18 1174 ``` Compass command: ``` /give_compass Construction UIIPUtX15oUiEzMgow75ZQC83TNLHsUd D2691E 1979 18 1174 ```
AliasAlreadyTaken was assigned by yourland-report 2023-05-29 23:35:42 +00:00
AliasAlreadyTaken added the
1. kind/enhancement
label 2023-05-30 00:30:08 +00:00
Member

interesting proposal. note that this will necessarily not be complete, as it won't know anything about client-generated formspecs, e.g. inventory, death, and the "escape" menu, as well as node metadata formspecs.

interesting proposal. note that this will necessarily *not* be complete, as it won't know anything about client-generated formspecs, e.g. inventory, death, and the "escape" menu, as well as node metadata formspecs.

Grrr, you're right. Imagine minetest engine was a real game engine where you could build anything, not only minecraft-not-minecraft.

Death and inventory both can be intercepted, right? The Death formspec at least can be assumed active between death and respawn. The Inventory formspec ... how does it open at all?

Grrr, you're right. Imagine minetest engine was a real game engine where you could build anything, not only minecraft-not-minecraft. Death and inventory both can be intercepted, right? The Death formspec at least can be assumed active between death and respawn. The Inventory formspec ... how does it open at all?
Member

Imagine minetest engine was a real game engine where you could build anything, not only minecraft-not-minecraft.

the real solution probably involves SSCSM. this is not an easy problem to solve.

Death and inventory both can be intercepted, right?

all formspecs can be "intercepted". bug me to fill this in tomorrow, i'm falling asleep.

> Imagine minetest engine was a real game engine where you could build anything, not only minecraft-not-minecraft. the real solution probably involves SSCSM. this is not an easy problem to solve. > Death and inventory both can be intercepted, right? all formspecs can be "intercepted". bug me to fill this in tomorrow, i'm falling asleep.
Member

all formspecs can be "intercepted". bug me to fill this in tomorrow, i'm falling asleep.

i'm not sure what i meant by this. the server gets info about what a player does in the inventory formspec, and sets the formspec itself, but there's no way to see what the player does with the death formspec or the escape menu formspec.

> all formspecs can be "intercepted". bug me to fill this in tomorrow, i'm falling asleep. i'm not sure what i meant by this. the server gets info about what a player does in the inventory formspec, and sets the formspec itself, but there's no way to see what the player does with the death formspec or the escape menu formspec.

Even if implemented, such a method might be quite inaccurate due to client-server desync:

I tried something like that in my chat_formspec mod, assuming that the fs would be closed as soon as the player submits my fs with a quit field. (to delete some context data I would no longer need if the player stops interacting with the mod)
This is what happend: #6300

now I remember #4640 (comment), so I searched for these lines...
It seems like the server already does caching like that:
658bc9fcc8/src/network/serverpackethandler.cpp (L1458)

I guess logs could reveal how often even the server fails with that task.

I currently try myself in formspec modding - I would be really interested how often these mismatches happen (memory vs. user experience tradeoff: can I afford asking the user to start again or do I have to store my data forever in case the formspec I expect to be closed isn't).

Even if implemented, such a method might be quite inaccurate due to client-server desync: I tried something like that in my chat_formspec mod, assuming that the fs would be closed as soon as the player submits my fs with a `quit` field. (to delete some context data I would no longer need if the player stops interacting with the mod) This is what happend: #6300 now I remember https://gitea.your-land.de/your-land/bugtracker/issues/4640#issuecomment-53176, so I searched for these lines... It seems like the server already does caching like that: https://github.com/minetest/minetest/blob/658bc9fcc896b6987cc7401992c3cb703fbf048e/src/network/serverpackethandler.cpp#L1458 I guess logs could reveal how often even the server fails with that task. I currently try myself in formspec modding - I would be really interested how often these mismatches happen (memory vs. user experience tradeoff: can I afford asking the user to start again or do I have to store my data forever in case the formspec I expect to be closed isn't).
Member

Another interesting thing to investigate:
There was a code in yl_speak_up that did basically:

minetest.register_on_player_receive_fields(function(player, formname, fields)
  minetest.show_formspec(playername, .., "whatever")
end)

i.e. showing same formspec as soon as you close it.

But it is still possible to just hold down esc button and break from this loop after some time.
I always wondered what exactly happens and what state is assumed after...

Another interesting thing to investigate: There was a code in yl_speak_up that did basically: ```lua minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.show_formspec(playername, .., "whatever") end) ``` i.e. showing same formspec as soon as you close it. But it is still possible to just hold down `esc` button and break from this loop after some time. I always wondered what exactly happens and what state is assumed after...
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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#4628
No description provided.