mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-22 11:12:57 +00:00
refactor: remove disconnect packet hack
This commit is contained in:
parent
cf94e7d162
commit
d181ed62f6
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue