Log item manipulation
Bloodlex opened this issue · 4 comments
Hello,
I think it would be nice to have a feature, to log everything that happened in someone else's inventory. It would allow me to perform better supervision over my server stuff.
For instance, it could be a simple .log file with information which item has been transferred to/from another player's inventory. It could log it after every drag&drop or provide a summary after the inventory editing is done. I think I like the idea with summary better, but I don't know exactly how hard it would be to implement that.
Maybe this log could be also accessible via some command that would for instance open a transfer history for a specific user that performs an action (a moderator or admin in that case) or for a player that is a subject to inventory manipulation (what has been taken from or given to).
Sometimes there are discussions on my server, that stuff is accused of taking something from player inventory, I would like to have some proof that it happened or not.
I hope you like my idea, please let me know how doable is that. Thanks a lot!
Best regards,
Bloodlex
I see this recently got moved into the GitHub project. Recently had some staff members request this as it would be very convenient. ❤️
This is one of the longer stretch goals - features like this will be addon plugins. Presumably this will hook Prism, possibly CoreProtect or LogBlock or whatever if their APIs are usable. Don't really want to write a logging and lookup system myself, and encouraging people to use proper tools sounds nice.
Addons won't happen until at least after I cut 5.0.0, which is a pretty large overhaul.
That sounds awesome.
In terms of logging, I was thinking more of something simple like darksaid98 Removed x1 "Renamed Diamond Pickaxe" from Someusers inventory
or darksaid98 Added x1 "Renamed Diamond Pickaxe" to Someusers inventory
being sent to the console.
Although quite verbose it could be exposed as a boolean in config, and would still expose edits in the server log for administrators to access.
The problem is that, as you pointed out, that's pretty verbose. Building a system with rolling logs isn't hard (the logging APIs included in Spigot make that a snap), but retrieving that information in game would be a massive PITA from raw logs. You'd have to load, parse, and filter all of the information. That consumes a lot of memory and I/O time, which means threading and resource consumption limiting. Mandating logging plugins for logging features will keep me sane and make the feature much more achievable. Being able to piggyback Prism, for example, means that lookups are as simple as using Prism normally, so all I'm on the hook for is presenting the information to Prism. Have I mentioned Prism? Prism is great. I WILL write an essay on how good it is, do not test me.
I also don't think a system where admins are expected to manually search logs is a good idea, that sounds like an awful user experience. Even with the power of grep on my side I didn't love it when I had to search logs, and I'll be honest, most of the people I administrated with would manually search files if they had to locate something. I really don't want to enable that, because I value their time even if they don't. I know it sounds harsh, but the vast majority of administrators are people who have little to no experience with server management. Most servers are run by people who know just enough to start a server and install plugins.
One of my secondary goals is to encourage people to move away from /searchcontainer
- not only is it easier to locate things pretty much anywhere with a logging plugin, it's also safer and gives actual information about how an item got to its current location. More exposure to real logging plugins means more people hopefully realizing /searchcontainer
is awful and not using it.