From 7ac73229da5212e40858f7b885b6e97ac7192e0c Mon Sep 17 00:00:00 2001 From: zhaodice <63996691+zhaodice@users.noreply.github.com> Date: Sun, 26 Jun 2022 15:08:06 +0800 Subject: [PATCH] Avoid disconnection notification --- .../packet/recv/HandlerPlayerForceExitReq.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerForceExitReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerForceExitReq.java index 84943757d..4f578021a 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerForceExitReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerPlayerForceExitReq.java @@ -12,6 +12,17 @@ public class HandlerPlayerForceExitReq extends PacketHandler { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { // Client should auto disconnect right now session.send(new BasePacket(PacketOpcodes.PlayerForceExitRsp)); - session.close(); + new Thread(){ + @Override + public void run() { + try { + Thread.sleep(1000);// disconnect after 1 seconds + } catch (InterruptedException e) { + e.printStackTrace(); + } + session.close(); + super.run(); + } + }.start(); } }