mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-28 17:45:34 +00:00
refactor: remove disconnect packet hack
This commit is contained in:
@@ -1318,20 +1318,7 @@ void ClientConnection::handleTileUpdate(
|
||||
|
||||
void ClientConnection::handleDisconnect(
|
||||
std::shared_ptr<DisconnectPacket> packet) {
|
||||
#if defined(__linux__)
|
||||
// Linux fix: On local host connections, ignore DisconnectPacket. The
|
||||
// singleplayer internal server should never disconnect itself. If we see
|
||||
// this, it's likely stream desync reading garbage data as a
|
||||
// DisconnectPacket.
|
||||
if (connection && connection->getSocket() &&
|
||||
connection->getSocket()->isLocal()) {
|
||||
fprintf(stderr,
|
||||
"[CONN] Ignoring DisconnectPacket on local connection "
|
||||
"(reason=%d)\n",
|
||||
packet->reason);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
connection->close(DisconnectPacket::eDisconnect_Kicked);
|
||||
done = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user