aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/LoginPacket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/LoginPacket.cpp')
-rw-r--r--Minecraft.World/LoginPacket.cpp20
1 files changed, 10 insertions, 10 deletions
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));
}