diff --git a/targets/java/src/File.cpp b/targets/java/src/File.cpp index 6a05e3caf..70b3caf80 100644 --- a/targets/java/src/File.cpp +++ b/targets/java/src/File.cpp @@ -61,7 +61,6 @@ File::File(const std::string& pathname) { if (fixedPath.find("GAME:/") == 0) fixedPath = fixedPath.substr(6); m_abstractPathName = fixedPath; -#if defined(__linux__) std::string request = std::filesystem::path(m_abstractPathName).string(); while (!request.empty() && request[0] == '/') request.erase(0, 1); if (request.find("res/") == 0) request.erase(0, 4); @@ -91,14 +90,13 @@ File::File(const std::string& pathname) { return; } } -#endif +// #ifdef _WINDOWS64 +// std::string path = std::filesystem::path(m_abstractPathName).string(); +// std::string finalPath = PlatformStorage.GetMountedPath(path.c_str()); +// if (finalPath.size() == 0) finalPath = path; +// m_abstractPathName = finalPath; +// #endif -#ifdef _WINDOWS64 - std::string path = std::filesystem::path(m_abstractPathName).string(); - std::string finalPath = PlatformStorage.GetMountedPath(path.c_str()); - if (finalPath.size() == 0) finalPath = path; - m_abstractPathName = finalPath; -#endif /* std::vector path = stringSplit( pathname, pathSeparator ); diff --git a/targets/minecraft/network/Connection.cpp b/targets/minecraft/network/Connection.cpp index 583c9402f..932253177 100644 --- a/targets/minecraft/network/Connection.cpp +++ b/targets/minecraft/network/Connection.cpp @@ -200,10 +200,10 @@ bool Connection::writeTick() { } Packet::writePacket(packet, bufferedDos); -#if defined(__linux__) - bufferedDos->flush(); // Ensure buffered data reaches socket before any - // other writes -#endif +// #if defined(__linux__) +// bufferedDos->flush(); // Ensure buffered data reaches socket before any +// // other writes +// #endif #if !defined(_CONTENT_PACKAGE) // 4J Added for debugging @@ -252,15 +252,15 @@ bool Connection::writeTick() { // write it to QNet as a single packet with priority flags Otherwise // just buffer the packet with other outgoing packets as the java game // did -#if defined(__linux__) - // Linux fix: For local connections, always use bufferedDos to avoid - // byte interleaving between the BufferedOutputStream buffer and direct - // sos writes. The shouldDelay/writeWithFlags path writes directly to - // sos, which can inject bytes BEFORE unflushed bufferedDos data. - Packet::writePacket(packet, bufferedDos); - bufferedDos->flush(); // Ensure data reaches socket immediately for - // delayed packets -#else +// #if defined(__linux__) +// // Linux fix: For local connections, always use bufferedDos to avoid +// // byte interleaving between the BufferedOutputStream buffer and direct +// // sos writes. The shouldDelay/writeWithFlags path writes directly to +// // sos, which can inject bytes BEFORE unflushed bufferedDos data. +// Packet::writePacket(packet, bufferedDos); +// bufferedDos->flush(); // Ensure data reaches socket immediately for +// // delayed packets +// #else if (packet->shouldDelay) { Packet::writePacket(packet, byteArrayDos); @@ -276,7 +276,7 @@ bool Connection::writeTick() { Packet::writePacket(packet, bufferedDos); } -#endif +// #endif #if !defined(_CONTENT_PACKAGE) // 4J Added for debugging diff --git a/targets/minecraft/network/Socket.h b/targets/minecraft/network/Socket.h index 380e6b4e1..f0cb5b491 100644 --- a/targets/minecraft/network/Socket.h +++ b/targets/minecraft/network/Socket.h @@ -3,10 +3,6 @@ #include #include #include -#ifndef __linux__ -#include -#include -#endif #include #include diff --git a/targets/minecraft/network/packet/PlayerInfoPacket.cpp b/targets/minecraft/network/packet/PlayerInfoPacket.cpp index f86955a7e..eaa94323e 100644 --- a/targets/minecraft/network/packet/PlayerInfoPacket.cpp +++ b/targets/minecraft/network/packet/PlayerInfoPacket.cpp @@ -4,9 +4,6 @@ #include "platform/network/network.h" #include "minecraft/server/level/ServerPlayer.h" #include "minecraft/server/network/PlayerConnection.h" -#ifndef __linux__ -#include -#endif // __linux__ #include "PlayerInfoPacket.h" PlayerInfoPacket::PlayerInfoPacket() {