Fixed a bug that was causing players to get stuck logged in

Fixed a bug that would cause players to get stuck in a client crash loop when logging out inside of a POH
Fixed a bug that let players reach objects that shouldn't be reachable
General disconnection reliability improvements
Adjusted the color of global chat for HD mode, the new color is #f1b04c
This commit is contained in:
Ceikry
2023-03-05 11:00:06 +00:00
committed by Ryan
parent c2cb359bf7
commit ff18f69dd0
14 changed files with 91 additions and 151 deletions
+2 -4
View File
@@ -61,8 +61,8 @@ public class IoEventHandler {
IoSession session = (IoSession) key.attachment();
try {
if (channel.read(buffer) == -1) {
if (session != null && session.getPlayer() != null) {
Repository.getDisconnectionQueue().add(session.getPlayer(), false);
if (session != null) {
session.disconnect();
}
key.cancel();
return;
@@ -70,8 +70,6 @@ public class IoEventHandler {
} catch (IOException e) {
if (e.getMessage().contains("reset by peer") && session != null) {
session.disconnect();
if (session.getPlayer() != null)
Repository.getDisconnectionQueue().add(session.getPlayer(), false);
} else {
key.cancel();
return;
+6 -11
View File
@@ -216,17 +216,12 @@ public class IoSession {
key.cancel();
SocketChannel channel = (SocketChannel) key.channel();
channel.socket().close();
if (object instanceof Player) {
final Player p = getPlayer();
GameWorld.getPulser().submit(new Pulse(0) {
@Override
public boolean pulse() {
if (p.isActive() && !p.getSession().active) {
p.clear();
}
return true;
}
});
if (getPlayer() != null) {
try {
getPlayer().clear();
} catch (Exception e) {
e.printStackTrace();
}
}
object = null;
} catch (IOException e) {
+1 -2
View File
@@ -26,6 +26,7 @@ import core.game.world.repository.Repository
import core.tools.Log
import core.worker.ManagementEvents.publish
import java.io.File
import java.io.IOException
import java.math.BigInteger
import java.nio.BufferUnderflowException
import java.nio.ByteBuffer
@@ -163,8 +164,6 @@ object Login {
} catch (e: Exception) {
e.printStackTrace()
session.disconnect()
Repository.removePlayer(player)
player.clear(true)
}
}