diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/PreLoginPacket.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/PreLoginPacket.h')
| -rw-r--r-- | Minecraft.World/PreLoginPacket.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Minecraft.World/PreLoginPacket.h b/Minecraft.World/PreLoginPacket.h new file mode 100644 index 00000000..243f2f36 --- /dev/null +++ b/Minecraft.World/PreLoginPacket.h @@ -0,0 +1,39 @@ +#pragma once +using namespace std; + +#include "Packet.h" + +class PreLoginPacket : public Packet, public enable_shared_from_this<PreLoginPacket> +{ + // the login key is username client->server and sessionid server->client +public: + static const int m_iSaveNameLen=14; + //4J Added more info to this packet so that we can check if anyone has a UGC privilege that won't let us + // join, and so that we can inform the server if we have that privilege set. Anyone with UGC turned off completely + // can't play the game online at all, so we only need to specify players with friends only set + PlayerUID *m_playerXuids; + DWORD m_dwPlayerCount; + BYTE m_friendsOnlyBits; + DWORD m_ugcPlayersVersion; + BYTE m_szUniqueSaveName[m_iSaveNameLen]; // added for checking if the level is in the ban list + DWORD m_serverSettings; // A bitfield of server settings constructed with the MAKE_SERVER_SETTINGS macro + BYTE m_hostIndex; // Rather than sending the xuid of the host again, send an index into the m_playerXuids array + DWORD m_texturePackId; + SHORT m_netcodeVersion; + + wstring loginKey; + + PreLoginPacket(); + PreLoginPacket(wstring userName); + PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId); + ~PreLoginPacket(); + + virtual void read(DataInputStream *dis); + virtual void write(DataOutputStream *dos); + virtual void handle(PacketListener *listener); + virtual int getEstimatedSize(); + +public: + static shared_ptr<Packet> create() { return shared_ptr<Packet>(new PreLoginPacket()); } + virtual int getId() { return 2; } +};
\ No newline at end of file |
