Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log every inventory action #360

Merged
merged 11 commits into from
Jun 12, 2024

Conversation

Emojigit
Copy link
Contributor

This PR adds logging functions to every inventory action. The existing logging functions for chests are also improved. This PR is ready for review.

@S-S-X
Copy link
Member

S-S-X commented Apr 20, 2024

Error → spec/api_spec.lua @ 6
CNC API
api.lua:386: attempt to index global 'technic' (a nil value)

Just use technic_cnc.use_technic to check if technic namespace is usable with CNC.
Technic is optional dependency for CNC, it also works without technic mod. Both cases are tested: with and without technic mod.

@OgelGames
Copy link
Contributor

The technic.machine_on_inventory_* functions don't need to return functions, you can use minetest.get_node(pos).name to get the node name.

@BuckarooBanzay BuckarooBanzay added the Enhancement New feature or request label Apr 21, 2024
@Emojigit
Copy link
Contributor Author

Emojigit commented Jun 4, 2024

For some reason, pipeworks is requiring fakelib... That's why mtt failed.

@BuckarooBanzay
Copy link
Member

BuckarooBanzay commented Jun 4, 2024

For some reason, pipeworks is requiring fakelib... That's why mtt failed.

Yeah, you can ignore that, i'll create another PR to add that dependency 👍

EDIT: #365 (or add the line here, i don't mind either way 🤷)

technic_cnc/api.lua Outdated Show resolved Hide resolved
technic_chests/inventory.lua Outdated Show resolved Hide resolved
technic_chests/register.lua Outdated Show resolved Hide resolved
technic_chests/register.lua Outdated Show resolved Hide resolved
technic/machines/register/common.lua Outdated Show resolved Hide resolved
@OgelGames
Copy link
Contributor

Do you think it would be a good idea to handle non-player actions like default does? With all the extra logging, there's going to be a lot of spam from pipeworks moving items.

https://github.com/minetest/minetest_game/blob/511619253facd524df75ae44537d7b2c4e30a8db/mods/default/functions.lua#L729-L745

@SwissalpS SwissalpS changed the title Log every inventory actions Log every inventory action Jun 6, 2024
@OgelGames
Copy link
Contributor

I've created a new issue about my suggestion, so I'm merging this.

@OgelGames OgelGames merged commit be25d97 into mt-mods:master Jun 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants