rheo reports: we need code to prevent non-st ... #2542

Closed
opened 2022-08-25 18:53:25 +00:00 by yourland-report · 5 comments

rheo reports a bug:

we need code to prevent non-staff from wearing admin armor if they somehow encounter it

Player position:

{
	x = -27.799999237061,
	y = 65.096000671387,
	z = 15715.799804688
}

Player look:

{
	x = 0.89332497119904,
	y = -0.40146827697754,
	z = -0.20197468996048
}

Player information:

{
	major = 5,
	minor = 6,
	version_string = "5.6.0",
	ip_version = 6,
	protocol_version = 40,
	max_rtt = 2.5920000076294,
	lang_code = "",
	min_jitter = 0,
	max_jitter = 2.4240000247955,
	avg_jitter = 0.0030000060796738,
	connection_uptime = 819,
	serialization_version = 29,
	patch = 0,
	state = "Active",
	formspec_version = 6,
	avg_rtt = 0.20100000500679,
	min_rtt = 0.15999999642372
}

Player meta:

{
	fields = {
		played_time = "1557629",
		digged_nodes = "6765",
		placed_nodes = "13637",
		hud_state = "off",
		crafted = "251",
		yl_commons_player_created = "1644205752",
		partychat = "party",
		xp = "0",
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", [4] = \"unified_inventory:bag_large\"}",
		arenalib_infobox_arenaID = "0",
		["ocean_build.ocean_built"] = "2",
		["stamina:level"] = "0",
		punch_count = "876",
		["stamina:poisoned"] = "no",
		jointime = "1644205752",
		yl_commons_thankyou = "22",
		["3d_armor_inventory"] = "return {\"nether_mobs:dragon_boots 1 9700\", \"\", \"\", \"\", \"\", \"\"}",
		["ethereal:fly_timer"] = "-99",
		bitten = "0",
		died = "2",
		["ocean_build.last_warning"] = "1.6588e+09",
		yl_church = "return {[\"last_death\"] = {[\"y\"] = 15, [\"x\"] = 1353, [\"z\"] = 1089}}",
		["signslib:pos"] = "(2153,19,1181)",
		["stamina:exhaustion"] = "72",
		inflicted_damage = "145572",
		repellant = "0",
		yl_commons_player_joined = "1661452807"
	}
}

Log identifier


[MOD] yl_report log identifier = IHKoKLhJ0UDYFV2fxntc65X8XjZdM9DK

Profiler save:

profile-20220825T185324.json_prettyEE

Status:

# Server: version: 5.5.1-yl | game: Minetest Game | uptime: 2d 20h 14min 11s | max lag: 2.78s | clients: DiamondDude10, mad-dog86, Lupercus, rheo, Sokomine, Unelias, wordes, Mielle, johhn, daydream, Coolstorms, Polya, Davidsoft, Ravise, pitman, Hulda, Boot, Service, AliasAlreadyTaken, Chache, Bishiro, hbreturns, Bailiff, tour, flux

Teleport command:

/teleport xyz -28 65 15716

Compass command:

/give_compass Construction IHKoKLhJ0UDYFV2fxntc65X8XjZdM9DK D2691E -28 65 15716
rheo reports a bug: > we need code to prevent non-staff from wearing admin armor if they somehow encounter it Player position: ``` { x = -27.799999237061, y = 65.096000671387, z = 15715.799804688 } ``` Player look: ``` { x = 0.89332497119904, y = -0.40146827697754, z = -0.20197468996048 } ``` Player information: ``` { major = 5, minor = 6, version_string = "5.6.0", ip_version = 6, protocol_version = 40, max_rtt = 2.5920000076294, lang_code = "", min_jitter = 0, max_jitter = 2.4240000247955, avg_jitter = 0.0030000060796738, connection_uptime = 819, serialization_version = 29, patch = 0, state = "Active", formspec_version = 6, avg_rtt = 0.20100000500679, min_rtt = 0.15999999642372 } ``` Player meta: ``` { fields = { played_time = "1557629", digged_nodes = "6765", placed_nodes = "13637", hud_state = "off", crafted = "251", yl_commons_player_created = "1644205752", partychat = "party", xp = "0", ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", [4] = \"unified_inventory:bag_large\"}", arenalib_infobox_arenaID = "0", ["ocean_build.ocean_built"] = "2", ["stamina:level"] = "0", punch_count = "876", ["stamina:poisoned"] = "no", jointime = "1644205752", yl_commons_thankyou = "22", ["3d_armor_inventory"] = "return {\"nether_mobs:dragon_boots 1 9700\", \"\", \"\", \"\", \"\", \"\"}", ["ethereal:fly_timer"] = "-99", bitten = "0", died = "2", ["ocean_build.last_warning"] = "1.6588e+09", yl_church = "return {[\"last_death\"] = {[\"y\"] = 15, [\"x\"] = 1353, [\"z\"] = 1089}}", ["signslib:pos"] = "(2153,19,1181)", ["stamina:exhaustion"] = "72", inflicted_damage = "145572", repellant = "0", yl_commons_player_joined = "1661452807" } } ``` Log identifier ``` [MOD] yl_report log identifier = IHKoKLhJ0UDYFV2fxntc65X8XjZdM9DK ``` Profiler save: ``` profile-20220825T185324.json_prettyEE ``` Status: ``` # Server: version: 5.5.1-yl | game: Minetest Game | uptime: 2d 20h 14min 11s | max lag: 2.78s | clients: DiamondDude10, mad-dog86, Lupercus, rheo, Sokomine, Unelias, wordes, Mielle, johhn, daydream, Coolstorms, Polya, Davidsoft, Ravise, pitman, Hulda, Boot, Service, AliasAlreadyTaken, Chache, Bishiro, hbreturns, Bailiff, tour, flux ``` Teleport command: ``` /teleport xyz -28 65 15716 ``` Compass command: ``` /give_compass Construction IHKoKLhJ0UDYFV2fxntc65X8XjZdM9DK D2691E -28 65 15716 ```
AliasAlreadyTaken was assigned by yourland-report 2022-08-25 18:53:25 +00:00
flux added the
1. kind/enhancement
2. prio/critical
labels 2022-08-25 19:06:17 +00:00
Member

see https://github.com/BlockySurvival/bls_custom/blob/master/custom_items/staff_armor.lua

ideally this would be done by overriding the allow_put functionality of the 3d_armor inventory, but that's unfortunately not accessible.

EDIT: actually it could probably be done via overriding armor:set_player_armor

see https://github.com/BlockySurvival/bls_custom/blob/master/custom_items/staff_armor.lua ideally this would be done by overriding the `allow_put` functionality of the 3d_armor inventory, but that's unfortunately not accessible. EDIT: actually it could probably be done via overriding `armor:set_player_armor`
flux added this to the flux's TODO list project 2022-08-25 19:11:06 +00:00
AliasAlreadyTaken was unassigned by flux 2022-08-25 19:11:10 +00:00
flux self-assigned this 2022-08-25 19:11:10 +00:00
flux added the
4. step/ready to QA test
label 2022-08-25 23:05:03 +00:00
Member

implemented in 0d8b2b95de

implemented in https://gitea.your-land.de/your-land/yl_commons/commit/0d8b2b95dea124b10b48276c7565c6957cf29783

Could we prevent all inventory transaction involving admin items? Or is that exactly the allow_put problem? If so, why is this option not available?

Could we prevent all inventory transaction involving admin items? Or is that exactly the allow_put problem? If so, why is this option not available?
AliasAlreadyTaken added this to the 1.1.115 milestone 2022-08-25 23:32:41 +00:00
Member

Could we prevent all inventory transaction involving admin items? Or is that exactly the allow_put problem? If so, why is this option not available?

not easily, there's 3 separate mechanisms to mange the 3 kinds of inventory:

node inventories are managed by the callbacks in the node's definition.

player inventories are managed by minetest.register_allow_player_inventory_action and minetest.register_on_player_inventory_action.

detached inventories are managed when the detached inventory is created.

also, mods generally modify inventories directly w/out attempting to check whether the action is "allowed".

i think the first 3 things could actually be handled automatically;

for node inventories, override node definitions when on_mods_loaded (i think that will work).

for player inventories, that's pretty straightforward.

for detached inventories, override minetest.create_detached_inventory, like i did in this fix, could possibly work more generally.

however, none of that would catch the case of e.g. someone collecting an admin pickaxe from a bones block, or equiping armor by holding it and right-click.

> Could we prevent all inventory transaction involving admin items? Or is that exactly the allow_put problem? If so, why is this option not available? not easily, there's 3 separate mechanisms to mange the 3 kinds of inventory: node inventories are managed by the callbacks in the node's definition. player inventories are managed by `minetest.register_allow_player_inventory_action` and `minetest.register_on_player_inventory_action`. detached inventories are managed when the detached inventory is created. also, mods generally modify inventories directly w/out attempting to check whether the action is "allowed". i think the first 3 things could actually be handled automatically; for node inventories, override node definitions when `on_mods_loaded` (i *think* that will work). for player inventories, that's pretty straightforward. for detached inventories, override `minetest.create_detached_inventory`, like i did in this fix, could possibly work more generally. however, none of that would catch the case of e.g. someone collecting an admin pickaxe from a bones block, or equiping armor by holding it and right-click.
flux removed this from the flux's TODO list project 2022-08-31 02:00:27 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2022-08-31 02:00:32 +00:00
flux removed their assignment 2022-08-31 02:00:35 +00:00
Member

live

live
flux closed this issue 2022-08-31 02:01:21 +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#2542
No description provided.