mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 21:52:05 -07:00
Make sure the player didn't disconnect when processing commands
This commit is contained in:
@@ -30,6 +30,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
} else {
|
} else {
|
||||||
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
|
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
|
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||||
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
|
||||||
if (!this.updateChatOrder(timestamp)) {
|
if (!this.updateChatOrder(timestamp)) {
|
||||||
|
Reference in New Issue
Block a user