aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/LoginPacket.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/LoginPacket.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/LoginPacket.cpp')
-rw-r--r--Minecraft.World/LoginPacket.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp
index 79cdfbae..44ed62b3 100644
--- a/Minecraft.World/LoginPacket.cpp
+++ b/Minecraft.World/LoginPacket.cpp
@@ -30,7 +30,7 @@ LoginPacket::LoginPacket()
m_playerCapeId = 0;
m_isGuest = false;
m_newSeaLevel = false;
- m_pLevelType = nullptr;
+ m_pLevelType = NULL;
m_uiGamePrivileges = 0;
m_xzSize = LEVEL_MAX_WIDTH;
m_hellScale = HELL_LEVEL_MAX_SCALE;
@@ -59,7 +59,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o
m_playerCapeId = capeId;
m_isGuest = isGuest;
m_newSeaLevel = false;
- m_pLevelType = nullptr;
+ m_pLevelType = NULL;
m_uiGamePrivileges = 0;
m_xzSize = LEVEL_MAX_WIDTH;
m_hellScale = HELL_LEVEL_MAX_SCALE;
@@ -100,7 +100,7 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException
userName = readUtf(dis, Player::MAX_NAME_LENGTH);
wstring typeName = readUtf(dis, 16);
m_pLevelType = LevelType::getLevelType(typeName);
- if (m_pLevelType == nullptr)
+ if (m_pLevelType == NULL)
{
m_pLevelType = LevelType::lvl_normal;
}
@@ -135,7 +135,7 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException
{
dos->writeInt(clientVersion);
writeUtf(userName, dos);
- if (m_pLevelType == nullptr)
+ if (m_pLevelType == NULL)
{
writeUtf(L"", dos);
}
@@ -174,10 +174,10 @@ void LoginPacket::handle(PacketListener *listener)
int LoginPacket::getEstimatedSize()
{
int length=0;
- if (m_pLevelType != nullptr)
+ if (m_pLevelType != NULL)
{
- length = static_cast<int>(m_pLevelType->getGeneratorName().length());
+ length = (int)m_pLevelType->getGeneratorName().length();
}
- return static_cast<int>(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2 * sizeof(PlayerUID)) + 1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int));
+ return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int));
}