Paper
Paper copied to clipboard
Support applicable API during config stage
There are at least 2 events I know of that fire during the configuration stage before the ServerGamePacketListenerImpl has been created: PlayerClientOptionsChangeEvent and PlayerSpawnLocationEvent. In addition, there are the listeners for custom payloads that also run. This PR adds support for the functionality that is supported during the configuration phase, namely kicking players, sending custom resource packs, and sending custom payloads.
- [x] kick API
- [x] sending resource pack API
- [x] ~~custom channel stuff~~will handle at a later time
I think we should have an API to keep the player in config for a while as well while e.g. the resource pack is loading. Especially because of this issue right here https://github.com/PaperMC/Velocity/issues/1164.
That is outside the scope of this PR. This is just intending to support already-existing API that is valid for use during the configuration phase. Don't interpret this as saying such API shouldn't exist however.
Anyone have any idea how long until this PR is merged? Isn't it as simple as just clicking the button now?
@cometcake575 this PR is still in draft, it even has a todo list in the description with at least one item that needs looking at. then the code needs to be reviewed by the team, tested and then it can be integrated. integrating is more complicated than just pressing the button because of how our patching works. tldr: be patient
Is there any progress?
I did say elsewhere about making Player more attached to the Network, but, we could maybe go for a more overarching thing of just offering a wrapper for the connection itself which lets you stem off into a configuring client, which lets you see methods only available in that phase, as well as a more general one that lets you get the player? not really sure how that would look, but, we also need to approach this for earlier stage stuff too, anyways, i.e. login plugin messaging API, as well as all of the task stuff needed for supporting the configuration protocol and its operations here
The Player should be supported in PlayerSpawnLocationEvent which is in a location after vanilla creates ServerPlayer but before the game connection is created. So either way, the Player interface has to have some support for stuff before the game packet listener is created.
Player is exposed in multiple places before where vanilla creates it, The login event, the resource pack events, the kick event and probably some more I'm missing.