aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/MinecraftServer.h
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
commit42aec6dac53dffa6afe072560a7e1d4986112538 (patch)
tree0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.Client/MinecraftServer.h
parentc9d58eeac7c72f0b3038e084667b4d89a6249fce (diff)
parentef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff)
Merge branch 'main' into pr/win64-world-saves
# Conflicts: # Minecraft.Client/MinecraftServer.cpp # README.md
Diffstat (limited to 'Minecraft.Client/MinecraftServer.h')
-rw-r--r--Minecraft.Client/MinecraftServer.h41
1 files changed, 37 insertions, 4 deletions
diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h
index ac99a415..7fa8c752 100644
--- a/Minecraft.Client/MinecraftServer.h
+++ b/Minecraft.Client/MinecraftServer.h
@@ -20,6 +20,10 @@ class CommandDispatcher;
#define MINECRAFT_SERVER_SLOW_QUEUE_DELAY 250
+#if defined _XBOX_ONE || defined _XBOX || defined __ORBIS__ || defined __PS3__ || defined __PSVITA__
+#define _ACK_CHUNK_SEND_THROTTLING
+#endif
+
typedef struct _LoadSaveDataThreadParam
{
LPVOID data;
@@ -100,6 +104,7 @@ private:
// vector<Tickable *> tickables = new ArrayList<Tickable>(); // 4J - removed
CommandDispatcher *commandDispatcher;
vector<ConsoleInput *> consoleInput; // 4J - was synchronizedList - TODO - investigate
+ CRITICAL_SECTION m_consoleInputCS;
public:
bool onlineMode;
bool animals;
@@ -108,6 +113,8 @@ public:
bool allowFlight;
wstring motd;
int maxBuildHeight;
+ int playerIdleTimeout;
+ bool forceGameType;
private:
// 4J Added
@@ -133,8 +140,12 @@ private:
void endProgress();
void saveAllChunks();
void saveGameRules();
- void stopServer();
+ void stopServer(bool didInit);
+#ifdef _LARGE_WORLDS
+ void overwriteBordersForNewWorldSize(ServerLevel* level);
+ void overwriteHellBordersForNewWorldSize(ServerLevel* level, int oldHellSize);
+#endif
public:
void setMaxBuildHeight(int maxBuildHeight);
int getMaxBuildHeight();
@@ -149,9 +160,20 @@ public:
void setPvpAllowed(bool pvp);
bool isFlightAllowed();
void setFlightAllowed(bool allowFlight);
+ bool isCommandBlockEnabled();
bool isNetherEnabled();
bool isHardcore();
+ int getOperatorUserPermissionLevel();
CommandDispatcher *getCommandDispatcher();
+ Pos *getCommandSenderWorldPosition();
+ Level *getCommandSenderWorld();
+ int getSpawnProtectionRadius();
+ bool isUnderSpawnProtection(Level *level, int x, int y, int z, shared_ptr<Player> player);
+ void setForceGameType(bool forceGameType);
+ bool getForceGameType();
+ static __int64 getCurrentTimeMillis();
+ int getPlayerIdleTimeout();
+ void setPlayerIdleTimeout(int playerIdleTimeout);
public:
void halt();
@@ -221,10 +243,16 @@ private:
bool m_isServerPaused;
// 4J Added - A static that stores the QNet index of the player that is next allowed to send a packet in the slow queue
+#ifdef _ACK_CHUNK_SEND_THROTTLING
+ static bool s_hasSentEnoughPackets;
+ static __int64 s_tickStartTime;
+ static vector<INetworkPlayer *> s_sentTo;
+ static const int MAX_TICK_TIME_FOR_PACKET_SENDS = 35;
+#else
static int s_slowQueuePlayerIndex;
static int s_slowQueueLastTime;
-public:
static bool s_slowQueuePacketSent;
+#endif
bool IsServerPaused() { return m_isServerPaused; }
@@ -234,9 +262,14 @@ private:
bool m_suspending;
public:
- //static int getSlowQueueIndex() { return s_slowQueuePlayerIndex; }
- static bool canSendOnSlowQueue(INetworkPlayer *player);
+ static bool chunkPacketManagement_CanSendTo(INetworkPlayer *player);
+ static void chunkPacketManagement_DidSendTo(INetworkPlayer *player);
+#ifndef _ACK_CHUNK_SEND_THROTTLING
static void cycleSlowQueueIndex();
+#endif
+
+ void chunkPacketManagement_PreTick();
+ void chunkPacketManagement_PostTick();
void setSaveOnExit(bool save) { m_saveOnExit = save; s_bSaveOnExitAnswered = true; }
void Suspend();