Arabella reports: a bug or a minor 'inconvenienc ... #826

Open
opened 2021-08-11 15:06:03 +00:00 by yourland-report · 7 comments

Arabella reports a bug:

a bug or a minor 'inconvenience' /area_pos1 123, 345, 567 with spaces in between :D

Player position:

{
	y = 12.696000099182,
	x = 10379.346679688,
	z = -5443.3022460938
}

Player look:

{
	y = -0.86854499578476,
	x = -0.11594843119383,
	z = -0.48185634613037
}

Player information:

{
	min_rtt = 0.043000001460314,
	max_rtt = 15.802000045776,
	connection_uptime = 28798,
	max_jitter = 14.743000030518,
	minor = 4,
	major = 5,
	ip_version = 6,
	formspec_version = 4,
	patch = 1,
	protocol_version = 39,
	serialization_version = 28,
	lang_code = "",
	version_string = "5.4.1",
	avg_rtt = 0.046000000089407,
	state = "Active",
	avg_jitter = 0.0029999986290932,
	min_jitter = 0
}

Player meta:

{
	fields = {
		["3d_armor_inventory"] = "return {\"\", \"\", \"shields:shield_admin\", \"\", \"3d_armor:boots_crystal 1 43760\", \"\"}",
		yl_commons_thankyou = "13",
		jointime = "1624205010",
		yl_commons_player_joined = "1628665594",
		["signslib:pos"] = "(10352,14,-5182)",
		digged_nodes = "36893",
		bitten = "0",
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}",
		partychat = "party",
		yl_church = "return {[\"last_death\"] = {[\"y\"] = 14, [\"x\"] = 10299, [\"z\"] = -5189}, [\"last_heal\"] = 1627128051, [\"last_death_portal\"] = 1627129276}",
		["stamina:level"] = "16",
		xp = "70043",
		arenalib_infobox_arenaID = "0",
		inflicted_damage = "121838",
		crafted = "377",
		played_time = "1465248",
		punch_count = "4934",
		placed_nodes = "35715",
		died = "9",
		hud_state = "on",
		repellant = "0",
		yl_commons_player_created = "1624205010"
	}
}

Log identifier


[MOD] yl_report log identifier = j1WrpMwFaBlCskjoFiRhguprigJSLecj

Profiler save:

profile-20210811T170603.json_pretty

Status:

# Server: version=5.4.1-yl, uptime=191054, max_lag=5.2221, clients={phillip, MrBlaza, BurstSetucalation, darealbang, debian44, wishingirl, Diaeresis, Arabella, Segmentation_Fault, Probator, Service, Bailiff, AliasAlreadyTaken, Ernesto}

Teleport command:

/teleport xyz 10379 13 -5443

Compass command:

/give_compass Construction j1WrpMwFaBlCskjoFiRhguprigJSLecj D2691E 10379 13 -5443
Arabella reports a bug: > a bug or a minor 'inconvenience' /area_pos1 123, 345, 567 with spaces in between :D Player position: ``` { y = 12.696000099182, x = 10379.346679688, z = -5443.3022460938 } ``` Player look: ``` { y = -0.86854499578476, x = -0.11594843119383, z = -0.48185634613037 } ``` Player information: ``` { min_rtt = 0.043000001460314, max_rtt = 15.802000045776, connection_uptime = 28798, max_jitter = 14.743000030518, minor = 4, major = 5, ip_version = 6, formspec_version = 4, patch = 1, protocol_version = 39, serialization_version = 28, lang_code = "", version_string = "5.4.1", avg_rtt = 0.046000000089407, state = "Active", avg_jitter = 0.0029999986290932, min_jitter = 0 } ``` Player meta: ``` { fields = { ["3d_armor_inventory"] = "return {\"\", \"\", \"shields:shield_admin\", \"\", \"3d_armor:boots_crystal 1 43760\", \"\"}", yl_commons_thankyou = "13", jointime = "1624205010", yl_commons_player_joined = "1628665594", ["signslib:pos"] = "(10352,14,-5182)", digged_nodes = "36893", bitten = "0", ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}", partychat = "party", yl_church = "return {[\"last_death\"] = {[\"y\"] = 14, [\"x\"] = 10299, [\"z\"] = -5189}, [\"last_heal\"] = 1627128051, [\"last_death_portal\"] = 1627129276}", ["stamina:level"] = "16", xp = "70043", arenalib_infobox_arenaID = "0", inflicted_damage = "121838", crafted = "377", played_time = "1465248", punch_count = "4934", placed_nodes = "35715", died = "9", hud_state = "on", repellant = "0", yl_commons_player_created = "1624205010" } } ``` Log identifier ``` [MOD] yl_report log identifier = j1WrpMwFaBlCskjoFiRhguprigJSLecj ``` Profiler save: ``` profile-20210811T170603.json_pretty ``` Status: ``` # Server: version=5.4.1-yl, uptime=191054, max_lag=5.2221, clients={phillip, MrBlaza, BurstSetucalation, darealbang, debian44, wishingirl, Diaeresis, Arabella, Segmentation_Fault, Probator, Service, Bailiff, AliasAlreadyTaken, Ernesto} ``` Teleport command: ``` /teleport xyz 10379 13 -5443 ``` Compass command: ``` /give_compass Construction j1WrpMwFaBlCskjoFiRhguprigJSLecj D2691E 10379 13 -5443 ```
AliasAlreadyTaken was assigned by yourland-report 2021-08-11 15:06:03 +00:00
Styxcolor added the
1. kind/bug
label 2021-11-03 03:53:58 +00:00
Styxcolor added the
4. step/question
label 2021-12-09 03:46:16 +00:00
flux added this to the flux's TODO list project 2022-10-24 04:58:35 +00:00
flux self-assigned this 2022-10-24 04:58:44 +00:00
flux added
2. prio/good first issue
and removed
4. step/question
labels 2023-02-27 23:46:11 +00:00

I believe this issue can be closed as it looks like this feature has been added upstream as documented here and appears fixed on ingame on YL.

I believe this issue can be closed as it looks like this feature has been added upstream as documented [here](https://github.com/minetest-mods/areas/blob/c044d49d21405b899659e68fae3bc39c57f7a2f9/README.md?plain=1#L36) and appears fixed on ingame on YL.
Member

not fixed - has to be commas or spaces, not both: image

not fixed - has to be commas or spaces, not both: ![image](/attachments/4b1acba0-827f-463f-af49-50985c4b6821)

Ok, I misunderstood the desired behavior. I can see how this is annoying.

Looking at the original code, the easiest fix I see is to handle the desired format using gsub to replace ', ' with ',' to convert the input to an acceptable format for pattern matching. Something like this:

local found, _, x, y, z = param:gsub(", ", ","):find("^(-?%d+)[, ](-?%d+)[, ](-?%d+)$")

This should handle using commas and/or spaces plus typos/combinations of both.

Are you looking to just override these chatcommands locally or need a PR for upstream or a fork of areas? I can pursue either if desired.

Ok, I misunderstood the desired behavior. I can see how this is annoying. Looking at the original code, the easiest fix I see is to handle the desired format using gsub to replace ', ' with ',' to convert the input to an acceptable format for pattern matching. Something like this: `local found, _, x, y, z = param:gsub(", ", ","):find("^(-?%d+)[, ](-?%d+)[, ](-?%d+)$")` This should handle using commas and/or spaces plus typos/combinations of both. Are you looking to just override these chatcommands locally or need a PR for upstream or a fork of areas? I can pursue either if desired.
Member

Are you looking to just override these chatcommands locally or need a PR for upstream or a fork of areas? I can pursue either if desired.

If it's not something yl-specific, then updating upstream is more desirable - it benefits not only us, and we have to resolve less conflicts when pulling upstream updates.

> Are you looking to just override these chatcommands locally or need a PR for upstream or a fork of areas? I can pursue either if desired. If it's not something yl-specific, then updating upstream is more desirable - it benefits not only us, and we have to resolve less conflicts when pulling upstream updates.

Upstream PR

I'll follow up if/when it is merged.

[Upstream PR](https://github.com/minetest-mods/areas/pull/73) I'll follow up if/when it is merged.
Member

i feel like there's a better solution that allows for a comma, any space character (%s), or a single comma with any number of space characters before or after it.

i feel like there's a better solution that allows for a comma, any space character (`%s`), or a single comma with any number of space characters before or after it.
Member

I would do it like this:

local x,y,z = param:match("^%s*(-?%d+)%s*,%s*(-?%d+)%s*,%s*(-?%d+)%s*$")
if not x then
  x,y,z = param:match("^%s*(-?%d+)%s+(-?%d+)%s+(-?%d+)%s*$")
end

Allows any amount of spaces between anything.
Does not allow mixing commas and spaces (sanity check)

I would do it like this: ```lua local x,y,z = param:match("^%s*(-?%d+)%s*,%s*(-?%d+)%s*,%s*(-?%d+)%s*$") if not x then x,y,z = param:match("^%s*(-?%d+)%s+(-?%d+)%s+(-?%d+)%s*$") end ``` Allows any amount of spaces between anything. Does not allow mixing commas and spaces (sanity check)
Sign in to join this conversation.
No Milestone
4 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#826
No description provided.