summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorMatti Hänninen <matti@mjhanninen.com>2015-08-05 00:24:59 +0200
committerMatti Hänninen <matti@mjhanninen.com>2015-08-12 15:51:38 +0200
commitb20294604c5a64a39b3c5f4491b653e4cf2a3c20 (patch)
treeab1b84a09987f8ebe9d1e8450f36375c0f9bc5db /src/Protocol/Protocol18x.cpp
parentMerge pull request #2425 from cuberite/APIDumpNameChange (diff)
downloadcuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.gz
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.bz2
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.lz
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.xz
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.tar.zst
cuberite-b20294604c5a64a39b3c5f4491b653e4cf2a3c20.zip
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index bd38d25d8..da5c451db 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -649,7 +649,7 @@ void cProtocol180::SendLogin(const cPlayer & a_Player, const cWorld & a_World)
Pkt.WriteBEUInt8(static_cast<UInt8>(a_Player.GetEffectiveGameMode()) | (Server->IsHardcore() ? 0x08 : 0)); // Hardcore flag bit 4
Pkt.WriteBEInt8(static_cast<Int8>(a_World.GetDimension()));
Pkt.WriteBEUInt8(2); // TODO: Difficulty (set to Normal)
- Pkt.WriteBEUInt8(Clamp<UInt8>(Server->GetMaxPlayers(), 0, 255));
+ Pkt.WriteBEUInt8(static_cast<UInt8>(Clamp<int>(Server->GetMaxPlayers(), 0, 255)));
Pkt.WriteString("default"); // Level type - wtf?
Pkt.WriteBool(false); // Reduced Debug Info - wtf?
}
@@ -2197,7 +2197,7 @@ void cProtocol180::HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBuffe
m_Client->Kick("Hacked client");
return;
}
- if (ntohl(DecryptedNonce[0]) != (unsigned)(uintptr_t)this) // Cannot convert to c++ casts
+ if (ntohl(DecryptedNonce[0]) != static_cast<unsigned>(reinterpret_cast<uintptr_t>(this)))
{
LOGD("Bad nonce value");
m_Client->Kick("Hacked client");
@@ -2247,7 +2247,7 @@ void cProtocol180::HandlePacketLoginStart(cByteBuffer & a_ByteBuffer)
Pkt.WriteVarInt32(static_cast<UInt32>(PubKeyDer.size()));
Pkt.WriteBuf(PubKeyDer.data(), PubKeyDer.size());
Pkt.WriteVarInt32(4);
- Pkt.WriteBEInt32((int)(intptr_t)this); // Using 'this' as the cryptographic nonce, so that we don't have to generate one each time :) Cannot convert to c++ casts
+ Pkt.WriteBEInt32(static_cast<int>(reinterpret_cast<intptr_t>(this))); // Using 'this' as the cryptographic nonce, so that we don't have to generate one each time :)
m_Client->SetUsername(Username);
return;
}
@@ -2406,7 +2406,7 @@ void cProtocol180::HandlePacketEntityAction(cByteBuffer & a_ByteBuffer)
void cProtocol180::HandlePacketKeepAlive(cByteBuffer & a_ByteBuffer)
{
HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, KeepAliveID);
- m_Client->HandleKeepAlive(static_cast<Int32>(KeepAliveID));
+ m_Client->HandleKeepAlive(KeepAliveID);
}