remove linux-specific networking paths

This commit is contained in:
Tropical 2026-04-09 23:06:13 -05:00
parent e7dca2570a
commit cf94e7d162
4 changed files with 20 additions and 29 deletions

View file

@ -61,7 +61,6 @@ File::File(const std::string& pathname) {
if (fixedPath.find("GAME:/") == 0) fixedPath = fixedPath.substr(6); if (fixedPath.find("GAME:/") == 0) fixedPath = fixedPath.substr(6);
m_abstractPathName = fixedPath; m_abstractPathName = fixedPath;
#if defined(__linux__)
std::string request = std::filesystem::path(m_abstractPathName).string(); std::string request = std::filesystem::path(m_abstractPathName).string();
while (!request.empty() && request[0] == '/') request.erase(0, 1); while (!request.empty() && request[0] == '/') request.erase(0, 1);
if (request.find("res/") == 0) request.erase(0, 4); if (request.find("res/") == 0) request.erase(0, 4);
@ -91,14 +90,13 @@ File::File(const std::string& pathname) {
return; 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<std::string> path = stringSplit( pathname, pathSeparator ); std::vector<std::string> path = stringSplit( pathname, pathSeparator );

View file

@ -200,10 +200,10 @@ bool Connection::writeTick() {
} }
Packet::writePacket(packet, bufferedDos); Packet::writePacket(packet, bufferedDos);
#if defined(__linux__) // #if defined(__linux__)
bufferedDos->flush(); // Ensure buffered data reaches socket before any // bufferedDos->flush(); // Ensure buffered data reaches socket before any
// other writes // // other writes
#endif // #endif
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
// 4J Added for debugging // 4J Added for debugging
@ -252,15 +252,15 @@ bool Connection::writeTick() {
// write it to QNet as a single packet with priority flags Otherwise // write it to QNet as a single packet with priority flags Otherwise
// just buffer the packet with other outgoing packets as the java game // just buffer the packet with other outgoing packets as the java game
// did // did
#if defined(__linux__) // #if defined(__linux__)
// Linux fix: For local connections, always use bufferedDos to avoid // // Linux fix: For local connections, always use bufferedDos to avoid
// byte interleaving between the BufferedOutputStream buffer and direct // // byte interleaving between the BufferedOutputStream buffer and direct
// sos writes. The shouldDelay/writeWithFlags path writes directly to // // sos writes. The shouldDelay/writeWithFlags path writes directly to
// sos, which can inject bytes BEFORE unflushed bufferedDos data. // // sos, which can inject bytes BEFORE unflushed bufferedDos data.
Packet::writePacket(packet, bufferedDos); // Packet::writePacket(packet, bufferedDos);
bufferedDos->flush(); // Ensure data reaches socket immediately for // bufferedDos->flush(); // Ensure data reaches socket immediately for
// delayed packets // // delayed packets
#else // #else
if (packet->shouldDelay) { if (packet->shouldDelay) {
Packet::writePacket(packet, byteArrayDos); Packet::writePacket(packet, byteArrayDos);
@ -276,7 +276,7 @@ bool Connection::writeTick() {
Packet::writePacket(packet, bufferedDos); Packet::writePacket(packet, bufferedDos);
} }
#endif // #endif
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
// 4J Added for debugging // 4J Added for debugging

View file

@ -3,10 +3,6 @@
#include <cstdint> #include <cstdint>
#include <format> #include <format>
#include <vector> #include <vector>
#ifndef __linux__
#include <qnet.h>
#include <xrnm.h>
#endif
#include <mutex> #include <mutex>
#include <queue> #include <queue>

View file

@ -4,9 +4,6 @@
#include "platform/network/network.h" #include "platform/network/network.h"
#include "minecraft/server/level/ServerPlayer.h" #include "minecraft/server/level/ServerPlayer.h"
#include "minecraft/server/network/PlayerConnection.h" #include "minecraft/server/network/PlayerConnection.h"
#ifndef __linux__
#include <qnet.h>
#endif // __linux__
#include "PlayerInfoPacket.h" #include "PlayerInfoPacket.h"
PlayerInfoPacket::PlayerInfoPacket() { PlayerInfoPacket::PlayerInfoPacket() {