mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-07-14 02:17:03 +00:00
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR
46 lines
1.6 KiB
C++
46 lines
1.6 KiB
C++
#pragma once
|
|
using namespace std;
|
|
|
|
#include "Packet.h"
|
|
class LevelType;
|
|
|
|
class LoginPacket : public Packet, public enable_shared_from_this<LoginPacket>
|
|
{
|
|
public:
|
|
int clientVersion;
|
|
wstring userName;
|
|
int64_t seed;
|
|
char dimension;
|
|
PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added
|
|
char difficulty; // 4J Added
|
|
bool m_friendsOnlyUGC; // 4J Added
|
|
DWORD m_ugcPlayersVersion; // 4J Added
|
|
INT m_multiplayerInstanceId; //4J Added for sentient
|
|
BYTE m_playerIndex; // 4J Added
|
|
DWORD m_playerSkinId, m_playerCapeId; // 4J Added
|
|
bool m_isGuest; // 4J Added
|
|
bool m_newSeaLevel; // 4J Added
|
|
LevelType *m_pLevelType;
|
|
unsigned int m_uiGamePrivileges;
|
|
int m_xzSize; // 4J Added
|
|
int m_hellScale; // 4J Added
|
|
|
|
// 1.8.2
|
|
int gameType;
|
|
BYTE mapHeight;
|
|
BYTE maxPlayers;
|
|
|
|
LoginPacket();
|
|
LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client
|
|
LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server
|
|
|
|
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 std::make_shared<LoginPacket>(); }
|
|
virtual int getId() { return 1; }
|
|
};
|