From b9a2951901dac21b08589c9d8b4a7eae78757726 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:39:35 +0700 Subject: Revert "Get rid of MSVC's __int64" This reverts commit d63f79325f85e014361eb8cf1e41eaebedb1ae71. --- Minecraft.World/LoginPacket.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Minecraft.World/LoginPacket.cpp') diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp index 44ed62b3..bfe69226 100644 --- a/Minecraft.World/LoginPacket.cpp +++ b/Minecraft.World/LoginPacket.cpp @@ -66,7 +66,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o } // Server -> Client -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) +LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) { this->userName = userName; this->clientVersion = clientVersion; @@ -94,13 +94,13 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType * m_hellScale = hellScale; } -void LoginPacket::read(DataInputStream *dis) //throws IOException +void LoginPacket::read(DataInputStream *dis) //throws IOException { clientVersion = dis->readInt(); userName = readUtf(dis, Player::MAX_NAME_LENGTH); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { m_pLevelType = LevelType::lvl_normal; } @@ -131,15 +131,15 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException } -void LoginPacket::write(DataOutputStream *dos) //throws IOException +void LoginPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(clientVersion); writeUtf(userName, dos); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -171,13 +171,13 @@ void LoginPacket::handle(PacketListener *listener) listener->handleLogin(shared_from_this()); } -int LoginPacket::getEstimatedSize() +int LoginPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != NULL) { length = (int)m_pLevelType->getGeneratorName().length(); } - 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)); + return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(__int64) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); } -- cgit v1.2.3