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

Require usage of ::create() for packets #95

Open
dktapps opened this issue Aug 11, 2022 · 0 comments
Open

Require usage of ::create() for packets #95

dktapps opened this issue Aug 11, 2022 · 0 comments

Comments

@dktapps
Copy link
Member

dktapps commented Aug 11, 2022

::create() was introduced to solve the issue of forgetting to initialize packet fields, which led to many confusing issues for plugin devs.

In furtherance of this goal, we need to prevent the use of new WhateverPacket entirely, and require the usage of WhateverPacket::create() exclusively. This would likely be achieved by making DataPacket::__construct() private, and introducing a DataPacket::fromBuffer() : static static method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant