refactor: remove disconnect packet hack

This commit is contained in:
Tropical 2026-04-09 23:07:54 -05:00
parent cf94e7d162
commit d181ed62f6
2 changed files with 1 additions and 17 deletions

View file

@ -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;

View file

@ -17,9 +17,6 @@ class ItemInstance;
class LivingEntity;
class Player;
class ResourceLocation;
#if !defined(__linux__)
#include <xmcore.h>
#endif
#include <stddef.h>
#include <stdint.h>