mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
Possible fix for needing kicks
This commit is contained in:
parent
0ed25421f8
commit
9c18af8f8d
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
package core.net;
|
package core.net;
|
||||||
|
|
||||||
import rs09.game.system.SystemLogger;
|
import rs09.game.system.SystemLogger;
|
||||||
|
import rs09.game.world.repository.DisconnectionQueue;
|
||||||
|
import rs09.game.world.repository.Repository;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
@ -60,6 +62,11 @@ public class IoEventHandler {
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(100_000);
|
ByteBuffer buffer = ByteBuffer.allocate(100_000);
|
||||||
IoSession session = (IoSession) key.attachment();
|
IoSession session = (IoSession) key.attachment();
|
||||||
if (channel.read(buffer) == -1) {
|
if (channel.read(buffer) == -1) {
|
||||||
|
if(session.getPlayer() != null){
|
||||||
|
Repository.getDisconnectionQueue().add(session.getPlayer());
|
||||||
|
}
|
||||||
|
key.cancel();
|
||||||
|
session.disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buffer.flip();
|
buffer.flip();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue