mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-12-02 22:18:09 +01:00
linux (compat): Add linux to most Win64 guards
This commit is contained in:
1 parent
8cf5675892
commit
9626065598
180 files changed
+941
-935
No files matched your search
@@ -10,7 +10,7 @@
|
||||
#include "../Minecraft.World/Socket.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.h"
|
||||
#include "MultiPlayerLevel.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../Minecraft.Server/Security/SecurityConfig.h"
|
||||
#include "../Minecraft.Server/ServerLogManager.h"
|
||||
#include "../Minecraft.Server/ServerLogger.h"
|
||||
@@ -50,7 +50,7 @@ void ServerConnection::addPlayerConnection(shared_ptr<PlayerConnection> uc)
|
||||
void ServerConnection::handleConnection(shared_ptr<PendingConnection> uc)
|
||||
{
|
||||
EnterCriticalSection(&pending_cs);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int maxPending = ServerRuntime::Security::GetSettings().maxPendingConnections;
|
||||
if (maxPending > 0 && static_cast<int>(pending.size()) >= maxPending)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ void ServerConnection::tick()
|
||||
vector< shared_ptr<PlayerConnection> > tempPlayers = players;
|
||||
LeaveCriticalSection(&players_cs);
|
||||
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Substep timing for chunk / tick / flush across all players.
|
||||
LARGE_INTEGER scFreq, scA, scB, scC, scD;
|
||||
QueryPerformanceFrequency(&scFreq);
|
||||
@@ -153,7 +153,7 @@ void ServerConnection::tick()
|
||||
unsigned int i = (unsigned int)((startIdx + k) % playerCount);
|
||||
shared_ptr<PlayerConnection> player = tempPlayers[i];
|
||||
shared_ptr<ServerPlayer> serverPlayer = player->getPlayer();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scA);
|
||||
#endif
|
||||
if( serverPlayer )
|
||||
@@ -161,12 +161,12 @@ void ServerConnection::tick()
|
||||
serverPlayer->updateFrameTick();
|
||||
serverPlayer->doChunkSendingTick(false);
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scB);
|
||||
sc_chunkUs += (scB.QuadPart - scA.QuadPart) * 1000000 / scFreq.QuadPart;
|
||||
#endif
|
||||
player->tick();
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scC);
|
||||
sc_tickUs += (scC.QuadPart - scB.QuadPart) * 1000000 / scFreq.QuadPart;
|
||||
#endif
|
||||
@@ -181,13 +181,13 @@ void ServerConnection::tick()
|
||||
{
|
||||
player->connection->flush();
|
||||
}
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
QueryPerformanceCounter(&scD);
|
||||
sc_flushUs += (scD.QuadPart - scC.QuadPart) * 1000000 / scFreq.QuadPart;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#if (defined(_WINDOWS64) || defined(__linux__)) && defined(MINECRAFT_SERVER_BUILD)
|
||||
int64_t sc_loopTotal = System::currentTimeMillis() - sc_loopT0;
|
||||
if (sc_loopTotal > 50)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user