mirror of
https://github.com/quizhizhe/LiteLoaderBDS-1.16.40.git
synced 2025-06-03 04:23:39 +00:00
71 lines
2.4 KiB
C++
71 lines
2.4 KiB
C++
// This Header is auto generated by BDSLiteLoader Toolchain
|
|
#pragma once
|
|
#define AUTO_GENERATED
|
|
#include "llapi/Global.h"
|
|
|
|
#define BEFORE_EXTRA
|
|
// Include Headers or Declare Types Here
|
|
#include "ServerNetworkHandler.hpp"
|
|
class ReadOnlyBinaryStream;
|
|
class BinaryStream;
|
|
class ServerPlayer;
|
|
class NetworkIdentifier;
|
|
enum StreamReadResult;
|
|
enum class PacketReliability {
|
|
Relible,
|
|
RelibleOrdered
|
|
};
|
|
#undef BEFORE_EXTRA
|
|
|
|
class Packet {
|
|
|
|
#define AFTER_EXTRA
|
|
// Add Member There
|
|
public:
|
|
unsigned mPriority = 2; //PacketPriority // 8
|
|
PacketReliability reliableOrdered = PacketReliability::RelibleOrdered; // 12
|
|
unsigned char clientSubId = 0; // 16
|
|
uint64_t mHandler = 0; // 24
|
|
uint64_t mCompressible = 0; // 32
|
|
//uint32_t incompressible = 0; // 40
|
|
|
|
// inline Packet(unsigned compress)
|
|
// : incompressible(!compress)
|
|
// { }
|
|
#define DISABLE_CONSTRUCTOR_PREVENTION_PACKET
|
|
inline Packet() {}
|
|
class Packet& operator=(class Packet const&) = delete;
|
|
Packet(class Packet const&) = delete;
|
|
|
|
inline ServerPlayer* getPlayerFromPacket(ServerNetworkHandler* handler, NetworkIdentifier* netId)
|
|
{
|
|
return handler->getServerPlayer(*netId, dAccess<char>(this, ll::offset::PACKET_OBJECTIVE_getDisplayName));
|
|
}
|
|
inline enum StreamReadResult _read(class ReadOnlyBinaryStream& binaryStream)
|
|
{
|
|
return read(binaryStream);
|
|
}
|
|
protected:
|
|
std::string toDebugString() {
|
|
return fmt::format("{}({})->{}", getName(), getId(), clientSubId);
|
|
}
|
|
#undef AFTER_EXTRA
|
|
#ifndef DISABLE_CONSTRUCTOR_PREVENTION_PACKET
|
|
public:
|
|
class Packet& operator=(class Packet const &) = delete;
|
|
Packet(class Packet const &) = delete;
|
|
Packet() = delete;
|
|
#endif
|
|
|
|
public:
|
|
/*0*/ virtual ~Packet();
|
|
/*1*/ virtual enum MinecraftPacketIds getId() const = 0;
|
|
/*2*/ virtual std::string getName() const = 0;
|
|
/*3*/ virtual void write(class BinaryStream &) const = 0;
|
|
/*4*/ virtual enum StreamReadResult read(class ReadOnlyBinaryStream &) = 0;
|
|
/*5*/ virtual struct ExtendedStreamReadResult readExtended(class ReadOnlyBinaryStream &);
|
|
/*6*/ virtual bool disallowBatching() const;
|
|
#ifdef ENABLE_VIRTUAL_FAKESYMBOL_PACKET
|
|
#endif
|
|
|
|
}; |