New File System and Cleanup some code Part 3

* Remove stdafx.h and some <unordered_set> includes
* Update Minecraft Server Defines and remove more unused folders/files
* Unbloat stdafx.h from Minecraft.World
This commit is contained in:
GabsPuNs
2026-05-24 21:23:25 -04:00
parent 145a1ca7a1
commit bc6c09146a
1569 changed files with 109 additions and 1602 deletions

View File

@@ -1,4 +1,3 @@
#include "stdafx.h"
#include "PendingConnection.h"
#include "PlayerConnection.h"
#include "ServerConnection.h"
@@ -14,7 +13,7 @@
#include "..\Minecraft.World\net.minecraft.world.item.h"
#include "..\Minecraft.World\SharedConstants.h"
#include "Settings.h"
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
#include "..\Minecraft.Server\ServerLogManager.h"
#include "..\Minecraft.Server\Access\Access.h"
#include "..\Minecraft.World\Socket.h"
@@ -29,7 +28,7 @@ Random *PendingConnection::random = new Random();
bool g_bRejectDuplicateNames = true;
#endif
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
namespace
{
static unsigned char GetPendingConnectionSmallId(Connection *connection)
@@ -214,7 +213,7 @@ void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
}
bool whitelistSatisfied = true;
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
if (ServerRuntime::Access::IsWhitelistEnabled())
{
whitelistSatisfied = false;
@@ -235,21 +234,21 @@ void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
}
else if (bannedXuid)
{
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
ServerRuntime::ServerLogManager::OnRejectedPlayerLogin(GetPendingConnectionSmallId(connection), name, ServerRuntime::ServerLogManager::eLoginRejectReason_BannedXuid);
#endif
disconnect(DisconnectPacket::eDisconnect_Banned);
}
else if (!whitelistSatisfied)
{
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
ServerRuntime::ServerLogManager::OnRejectedPlayerLogin(GetPendingConnectionSmallId(connection), name, ServerRuntime::ServerLogManager::eLoginRejectReason_NotWhitelisted);
#endif
disconnect(DisconnectPacket::eDisconnect_Banned);
}
else if (duplicateXuid)
{
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
ServerRuntime::ServerLogManager::OnRejectedPlayerLogin(GetPendingConnectionSmallId(connection), name, ServerRuntime::ServerLogManager::eLoginRejectReason_DuplicateXuid);
#endif
// Reject the incoming connection — a player with this UID is already
@@ -273,7 +272,7 @@ void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
}
if (nameTaken)
{
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
ServerRuntime::ServerLogManager::OnRejectedPlayerLogin(GetPendingConnectionSmallId(connection), name, ServerRuntime::ServerLogManager::eLoginRejectReason_DuplicateName);
#endif
app.DebugPrintf("Rejecting duplicate name: %ls\n", name.c_str());
@@ -333,7 +332,7 @@ void PendingConnection::handleAcceptedLogin(shared_ptr<LoginPacket> packet)
shared_ptr<ServerPlayer> playerEntity = server->getPlayers()->getPlayerForLogin(this, name, playerXuid,packet->m_onlineXuid);
if (playerEntity != nullptr)
{
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
#ifdef MINECRAFT_SERVER_BUILD
ServerRuntime::ServerLogManager::OnAcceptedPlayerLogin(GetPendingConnectionSmallId(connection), name);
#endif
server->getPlayers()->placeNewPlayer(connection, playerEntity, packet);