aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/PreLoginPacket.cpp
diff options
context:
space:
mode:
authorLoki <lokirautio@gmail.com>2026-03-09 06:53:08 -0500
committerGitHub <noreply@github.com>2026-03-09 06:53:08 -0500
commitbda3b1078ac357b805156a8802a0649f7021716e (patch)
tree838cf12ae598a810fb90a6e455f7fc03131f1342 /Minecraft.World/PreLoginPacket.cpp
parenta358a3caaee2a4781f910cfb440bd822ae73a7e5 (diff)
Port over RCE Patches from LCEMP (#1023)
* LCEMP RCE Fixes WIP Based on https://github.com/LCEMP/LCEMP/commit/d017bfc30a68888bf5c79b23cf5c4f607cf828bf * Update to LCEMP's ByteArrayIO version Fixes compilation since ours was missing some revisions from LCEMP * Add additional safety checks missed in first pass * Remove duplicate recipe count check
Diffstat (limited to 'Minecraft.World/PreLoginPacket.cpp')
-rw-r--r--Minecraft.World/PreLoginPacket.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Minecraft.World/PreLoginPacket.cpp b/Minecraft.World/PreLoginPacket.cpp
index aa6832ca..ddcfe197 100644
--- a/Minecraft.World/PreLoginPacket.cpp
+++ b/Minecraft.World/PreLoginPacket.cpp
@@ -62,6 +62,7 @@ void PreLoginPacket::read(DataInputStream *dis) //throws IOException
m_friendsOnlyBits = dis->readByte();
m_ugcPlayersVersion = dis->readInt();
m_dwPlayerCount = dis->readByte();
+ if( m_dwPlayerCount > MINECRAFT_NET_MAX_PLAYERS ) m_dwPlayerCount = MINECRAFT_NET_MAX_PLAYERS;
if( m_dwPlayerCount > 0 )
{
m_playerXuids = new PlayerUID[m_dwPlayerCount];
@@ -74,6 +75,7 @@ void PreLoginPacket::read(DataInputStream *dis) //throws IOException
{
m_szUniqueSaveName[i]=dis->readByte();
}
+ // m_szUniqueSaveName[m_iSaveNameLen - 1] = 0; // LCEMP does this but I have no idea why, TODO: why?
m_serverSettings = dis->readInt();
m_hostIndex = dis->readByte();