mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 21:37:28 +01:00
Make sure the player didn't disconnect when processing commands
This commit is contained in:
parent
2ba17103b9
commit
e5c8a57116
1 changed files with 6 additions and 0 deletions
|
@ -30,6 +30,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
} else {
|
||||
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
|
||||
|
||||
if (optional.isPresent()) {
|
||||
this.server.submit(() -> {
|
||||
+ if (player.hasDisconnected()) return; // Paper
|
||||
this.performChatCommand(packet, (LastSeenMessages) optional.get());
|
||||
this.detectRateSpam("/" + packet.command()); // Spigot
|
||||
});
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
||||
if (!this.updateChatOrder(timestamp)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue