Avoid disconnection notification

This commit is contained in:
zhaodice 2022-06-26 15:08:06 +08:00 committed by Melledy
parent 0bb2c6af38
commit 7ac73229da

View File

@ -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();
}
}