the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2using namespace std;
3
4#include "Packet.h"
5
6class PreLoginPacket : public Packet, public enable_shared_from_this<PreLoginPacket>
7{
8 // the login key is username client->server and sessionid server->client
9public:
10 static const int m_iSaveNameLen=14;
11 //4J Added more info to this packet so that we can check if anyone has a UGC privilege that won't let us
12 // join, and so that we can inform the server if we have that privilege set. Anyone with UGC turned off completely
13 // can't play the game online at all, so we only need to specify players with friends only set
14 PlayerUID *m_playerXuids;
15 DWORD m_dwPlayerCount;
16 BYTE m_friendsOnlyBits;
17 DWORD m_ugcPlayersVersion;
18 BYTE m_szUniqueSaveName[m_iSaveNameLen]; // added for checking if the level is in the ban list
19 DWORD m_serverSettings; // A bitfield of server settings constructed with the MAKE_SERVER_SETTINGS macro
20 BYTE m_hostIndex; // Rather than sending the xuid of the host again, send an index into the m_playerXuids array
21 DWORD m_texturePackId;
22 SHORT m_netcodeVersion;
23
24 wstring loginKey;
25
26 PreLoginPacket();
27 PreLoginPacket(wstring userName);
28 PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId);
29 ~PreLoginPacket();
30
31 virtual void read(DataInputStream *dis);
32 virtual void write(DataOutputStream *dos);
33 virtual void handle(PacketListener *listener);
34 virtual int getEstimatedSize();
35
36public:
37 static shared_ptr<Packet> create() { return shared_ptr<Packet>(new PreLoginPacket()); }
38 virtual int getId() { return 2; }
39};