-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3519: Queue configuration phase packets from API methods
- Loading branch information
Showing
3 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will need to be a queue for downstream packets too, like Server#sendData (PluginMessage), since plugins expect the user to be in GAME state during the ServerSwitchEvent for example. BungeeTitle will also need to be using the new queue function as it's calling Unsafe#sendPacket still
Then the to-server queue can be flushed on DownstreamBridge#handle(Login) to somewhat retain the plugin developers intentions.
0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PluginMessage is part of the configuration protocol so that shouldn't be an issue
0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably some plugins use internals
0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I request all occurences of
player.unsafe().sendPacket
in class https://github.com/SpigotMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/tab/ServerUnique.java to be replaced withplayer.sendPacketQueued
as well? I'm using the update methods to rely on BungeeCord's tablist entry tracker to remove them all on server switch. This change cannot be done from plugin side.0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear what you're asking / doing given that isn't API
0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True if the player is joining for the first time, but if they join, then do /server other, it'll throw an exception if a plugin is sending a PluginMessage downstream: https://pastebin.com/cR4EFQgk
Must be a bug then. This only happens if a plugin is sending a payload on the ServerSwitchEvent to the downstream server, just to reiterate
Example code:
0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the API gives me this (also thrown when using sendPacketQueued directly for other packets):
And this:
When sendPacketQueued does not throw, the packet may get lost. Then, on server switch, I get disconnected with:
There isn't any TabList API, so I'm sending packets. Instead of using sendPacket directly, I am calling that method to make the packet go though entry tracker that automatically clears all entries on server switch, so I don't need to do that anymore.I'll just force my way into the uuid collection using reflection.0509303
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open a separate ticket for any bugs or API requests.
I'm looking into this one, but I think it is difficult to fix given the way bungee is architected. A queue would be a temporary fix, but not correct