mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
InventoryManager: Defer opening new windows to the client until the window close handshake has been completed
fixes #5021 and probably a bunch of other inventory related glitches When the server initiates a window close, it does so by sending a ContainerClose to the client, which causes the client to behave as if it initiated the close itself. It responds by sending a ContainerClose back to the server, which the server is then expected to respond to. Sending the client a new window before sending this final response creates buggy behaviour on the client, which is problematic when switching windows. Therefore, we defer sending any new windows until after the client responds to our window close instruction, so that we can complete the window handshake correctly. This is a pile of complicated garbage that only exists because Mojang overengineered the process of opening and closing inventory windows.
This commit is contained in:
@ -2481,7 +2481,6 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO: client side race condition here makes the opening work incorrectly
|
||||
$this->removeCurrentWindow();
|
||||
|
||||
if(($inventoryManager = $this->getNetworkSession()->getInvManager()) === null){
|
||||
|
Reference in New Issue
Block a user