This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all,
Here is my PR for PlayerManager fixes and tweaks, i will go through what is changed below, and why imo it was done.
Note: All errors that i fixed actually happened during game play, most of these errors caused InvSync to fail outright.
Inventory sync would break if a mod was removed or an item name was altered when a player had an item from said mod in their inventory
Because the way the PlayerManager works, it just assumes that all the data it gets is correct and does not attempt to keep syncing the inventory when factorio throws an error. With my change the errors are logged to console and inventory sync still proceeds bypassing the items that no longer exist in the game.
Check for the existence of a grid, before attempting to modify it
Sometimes grids are modified or just outright removed from entities that had it before, I added a check to ensure grids exist before attempting to modify them.
Permissions are now different
The Default permissions group in my view should not allow the player to interact with the world until the admin has allowed the player to do so, this allows private servers to remain public without password. While this change is Marmite i would recommend that a configuration value could be created to define if the server is a private or public, and switch the default permission node accordingly. (Note: I changed this for my own server, it's private - which is why i explain about the Marmite side of things when Clustorio is used on public events)
Permissions should never be overwritten every time the server loads
Currently permission groups are reset to their hard coded values as defined at the top of the file every time the server starts, this in my view is wrong as if an admin were to change the permission system in game using /admin, their modifications would be reset.
Not only does this both stop confusion, but it also allows the admin to re-configure the permissions in game instead of having to go through this Lua script.