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

World: Track which chunks are used by each chunk loader. #3201

Open
dktapps opened this issue Dec 2, 2019 · 1 comment
Open

World: Track which chunks are used by each chunk loader. #3201

dktapps opened this issue Dec 2, 2019 · 1 comment
Labels
Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Dec 2, 2019

Description

Track a set of chunks which each chunk loader is attached to, indexed by chunk loader.

Justification

It's currently necessary for chunk loaders to have their own systems to track which chunks they are using, for example Player->usedChunks.
However, this is fragile and error-prone: it's possible to subscribe a Player as a chunk loader without it knowing.
This leads to a problem with disposal of Player after disconnect, because they cannot unassign themselves from chunks that they don't know they are assigned to.
Another manifestation is when a chunk loader is assigned to chunks in multiple worlds at the same time.

The net result of this change would be effectively equivalent to the current situation in terms of memory impact.
It would improve robustness by centralising loader chunk tracking, and allow for providing additional API features to simplify the use of chunk loaders, in addition to simplifying the implementation of chunk loaders.

@dktapps dktapps added Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Dec 2, 2019
@dktapps dktapps added this to the 4.0 milestone Dec 2, 2019
@dktapps
Copy link
Member Author

dktapps commented Oct 11, 2021

The impact of this issue with regard to players is eliminated by 217f9c5.

@dktapps dktapps removed this from the 4.0 milestone Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant