minetest-go/mtui

Specific use case information requirement(help search for bones)

Closed this issue · 2 comments

when I want to help players get to their bones. I can look up in mt_ui where the player died.
But what I can't see is if they have picked up their bones already.

From the log files I can see that by searching for the exact coordinates.
Would it be possible to add this functionality to mt_ui somehow?
I think that might be handy, but also a really specific use case. What do you think?

There are multiple ways to do this, each with its up- and downsides:

Log only on_punch of bones:bones

The on_punch function of the bones node could be overwritten (intercepted) with a logging-function that reports the event to the dieplayer event topic.

Upside: only a single event is logged (space-usage)
Downside: very specific implementation and very game-dependent (only works in the minetest-game)

References:

Log everything in the action category of minetest.log

Everything logged to minetest.log with the action category could be sent to the mtui-database and coordinates in the log-statement could be checked and parsed (later also searchable in the ui)

Upside: aside from crashes practically everything is logged and searchable (by position, player and date)
Downside: possible space- and cpu-issues, also: logs are duplicated (text-file and ui-database)


Personally i would go with option B and log everything but i'm not sure yet how this will pan out resource-wise.
I don't think disk-space is an issue, the logs are cleared after 30 days (https://github.com/minetest-go/mtui/blob/master/jobs/log_cleanup.go#L11-L12) but the sending over http to the ui might cause issues (it is batched but still)

I think i'll implement that and add it behind an option/setting to disable if it doesn't work out

This should work now as expected with https://github.com/minetest-go/mtui/releases/tag/v1.27 (5370a01)

If you search in the logs with nodename bones:bones and topic dignode you see who digged the bones where and when :)

Feel free to reopen if something is missing/buggy