1
0

Remove some unused inclusions

This commit is contained in:
Tiger Wang 2020-07-20 08:55:11 +01:00
parent 2f30e98dae
commit 07f3f7ec30
10 changed files with 22 additions and 40 deletions

View File

@ -93,13 +93,13 @@ void cChunkDataSerializer::SendToClients(const std::unordered_set<cClientHandle
} }
case cProtocol::Version::Version_1_13: case cProtocol::Version::Version_1_13:
{ {
Serialize393And401<&Palette_1_13::FromBlock>(Entry.second); // This version didn't last very long xD Serialize393<&Palette_1_13::FromBlock>(Entry.second); // This version didn't last very long xD
continue; continue;
} }
case cProtocol::Version::Version_1_13_1: case cProtocol::Version::Version_1_13_1:
case cProtocol::Version::Version_1_13_2: case cProtocol::Version::Version_1_13_2:
{ {
Serialize393And401<&Palette_1_13_1::FromBlock>(Entry.second); Serialize393<&Palette_1_13_1::FromBlock>(Entry.second);
continue; continue;
} }
} }
@ -391,7 +391,7 @@ void cChunkDataSerializer::Serialize110(const std::vector<cClientHandle *> & a_S
template <auto Palette> template <auto Palette>
void cChunkDataSerializer::Serialize393And401(const std::vector<cClientHandle *> & a_SendTo) void cChunkDataSerializer::Serialize393(const std::vector<cClientHandle *> & a_SendTo)
{ {
// This function returns the fully compressed packet (including packet size), not the raw packet! // This function returns the fully compressed packet (including packet size), not the raw packet!

View File

@ -38,7 +38,7 @@ protected:
void Serialize110(const std::vector<cClientHandle *> & a_SendTo); // Release 1.9.4 void Serialize110(const std::vector<cClientHandle *> & a_SendTo); // Release 1.9.4
template <auto Palette> template <auto Palette>
void Serialize393And401(const std::vector<cClientHandle *> & a_SendTo); // Release 1.13 - 1.13.1 void Serialize393(const std::vector<cClientHandle *> & a_SendTo); // Release 1.13 - 1.13.1
/** Finalises the data, compresses it if required, and delivers it to all clients. */ /** Finalises the data, compresses it if required, and delivers it to all clients. */
void CompressAndSend(cByteBuffer & a_Packet, const std::vector<cClientHandle *> & a_SendTo); void CompressAndSend(cByteBuffer & a_Packet, const std::vector<cClientHandle *> & a_SendTo);

View File

@ -11,7 +11,6 @@ Implements the 1.11 protocol classes:
#include "Globals.h" #include "Globals.h"
#include "Protocol_1_11.h" #include "Protocol_1_11.h"
#include "ProtocolRecognizer.h"
#include "Packetizer.h" #include "Packetizer.h"
#include "../WorldStorage/FastNBT.h" #include "../WorldStorage/FastNBT.h"

View File

@ -8,7 +8,6 @@ Implements the 1.12 protocol classes:
#include "Globals.h" #include "Globals.h"
#include "Protocol_1_12.h" #include "Protocol_1_12.h"
#include "ProtocolRecognizer.h"
#include "Packetizer.h" #include "Packetizer.h"
#include "../Entities/Boat.h" #include "../Entities/Boat.h"

View File

@ -8,8 +8,6 @@ Implements the 1.13 protocol classes:
#include "Globals.h" #include "Globals.h"
#include "Protocol_1_13.h" #include "Protocol_1_13.h"
#include "ProtocolRecognizer.h"
#include "ChunkDataSerializer.h"
#include "Packetizer.h" #include "Packetizer.h"
#include "../Entities/Boat.h" #include "../Entities/Boat.h"
@ -199,15 +197,6 @@ void cProtocol_1_13::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
cProtocol::Version cProtocol_1_13::GetProtocolVersion()
{
return Version::Version_1_13;
}
bool cProtocol_1_13::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) bool cProtocol_1_13::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType)
{ {
if (m_State != 3) if (m_State != 3)
@ -286,6 +275,15 @@ void cProtocol_1_13::HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer)
cProtocol::Version cProtocol_1_13::GetProtocolVersion()
{
return Version::Version_1_13;
}
UInt32 cProtocol_1_13::GetPacketID(ePacketType a_PacketType) UInt32 cProtocol_1_13::GetPacketID(ePacketType a_PacketType)
{ {
switch (a_PacketType) switch (a_PacketType)

View File

@ -19,14 +19,6 @@ Declares the 1.13 protocol classes:
#pragma once #pragma once
#include "Protocol_1_12.h" #include "Protocol_1_12.h"
#include "../World.h"
// fwd:
class BlockTypePalette;
@ -45,9 +37,9 @@ protected:
// Packet sending: // Packet sending:
virtual void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override; virtual void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
template <auto Palette> void SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); // Template to avoid virutal calls in tight loops template <auto Palette> void SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); // Template to avoid virtual calls in tight loops
virtual void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) override; virtual void SendBlockChanges (int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) override;
template <auto Palette>void SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes); // Template to avoid virutal calls in tight loops template <auto Palette>void SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes); // Template to avoid virtual calls in tight loops
virtual void SendMapData (const cMap & a_Map, int a_DataStartX, int a_DataStartY) override; virtual void SendMapData (const cMap & a_Map, int a_DataStartX, int a_DataStartY) override;
virtual void SendPaintingSpawn (const cPainting & a_Painting) override; virtual void SendPaintingSpawn (const cPainting & a_Painting) override;
virtual void SendParticleEffect (const AString & a_ParticleName, Vector3f a_Src, Vector3f a_Offset, float a_ParticleData, int a_ParticleAmount, std::array<int, 2> a_Data) override; virtual void SendParticleEffect (const AString & a_ParticleName, Vector3f a_Src, Vector3f a_Offset, float a_ParticleData, int a_ParticleAmount, std::array<int, 2> a_Data) override;
@ -57,16 +49,12 @@ protected:
virtual void SendTabCompletionResults (const AStringVector & a_Results) override; virtual void SendTabCompletionResults (const AStringVector & a_Results) override;
virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override; virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override;
/** Returns 1.13. */
virtual Version GetProtocolVersion() override;
// Packet receiving:
virtual bool HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) override;
virtual void HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer) override;
// Outgoing packet type translation: // Outgoing packet type translation:
virtual UInt32 GetPacketID(ePacketType a_PacketType) override; virtual UInt32 GetPacketID(ePacketType a_PacketType) override;
/** Returns 1.13. */
virtual Version GetProtocolVersion() override;
/** Converts eMonsterType to protocol-specific mob types */ /** Converts eMonsterType to protocol-specific mob types */
virtual UInt32 GetProtocolMobType(eMonsterType a_MobType) override; virtual UInt32 GetProtocolMobType(eMonsterType a_MobType) override;
@ -75,6 +63,10 @@ protected:
virtual std::pair<short, short> GetItemFromProtocolID(UInt32 a_ProtocolID); virtual std::pair<short, short> GetItemFromProtocolID(UInt32 a_ProtocolID);
virtual UInt32 GetProtocolIDFromItem(short a_ItemID, short a_ItemDamage); virtual UInt32 GetProtocolIDFromItem(short a_ItemID, short a_ItemDamage);
// Packet receiving:
virtual bool HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) override;
virtual void HandlePacketPluginMessage(cByteBuffer & a_ByteBuffer) override;
virtual bool ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t a_KeepRemainingBytes) override; virtual bool ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t a_KeepRemainingBytes) override;
virtual void WriteItem(cPacketizer & a_Pkt, const cItem & a_Item) override; virtual void WriteItem(cPacketizer & a_Pkt, const cItem & a_Item) override;
virtual void WriteEntityMetadata(cPacketizer & a_Pkt, const eEntityMetadata a_Metadata, const eEntityMetadataType a_FieldType); virtual void WriteEntityMetadata(cPacketizer & a_Pkt, const eEntityMetadata a_Metadata, const eEntityMetadataType a_FieldType);

View File

@ -8,9 +8,7 @@ Implements the 1.8 protocol classes:
*/ */
#include "Globals.h" #include "Globals.h"
#include "json/json.h"
#include "Protocol_1_8.h" #include "Protocol_1_8.h"
#include "ChunkDataSerializer.h"
#include "../mbedTLS++/Sha1Checksum.h" #include "../mbedTLS++/Sha1Checksum.h"
#include "Packetizer.h" #include "Packetizer.h"

View File

@ -15,7 +15,6 @@ Declares the 1.8 protocol classes:
#include "Protocol.h" #include "Protocol.h"
#include "../ByteBuffer.h" #include "../ByteBuffer.h"
#include "../World.h"
#include "../mbedTLS++/AesCfb128Decryptor.h" #include "../mbedTLS++/AesCfb128Decryptor.h"
#include "../mbedTLS++/AesCfb128Encryptor.h" #include "../mbedTLS++/AesCfb128Encryptor.h"

View File

@ -14,9 +14,7 @@ Implements the 1.9 protocol classes:
*/ */
#include "Globals.h" #include "Globals.h"
#include "json/json.h"
#include "Protocol_1_9.h" #include "Protocol_1_9.h"
#include "ChunkDataSerializer.h"
#include "../mbedTLS++/Sha1Checksum.h" #include "../mbedTLS++/Sha1Checksum.h"
#include "Packetizer.h" #include "Packetizer.h"

View File

@ -22,7 +22,6 @@ Declares the 1.9 protocol classes:
#include "Protocol.h" #include "Protocol.h"
#include "Protocol_1_8.h" #include "Protocol_1_8.h"
#include "../ByteBuffer.h" #include "../ByteBuffer.h"
#include "../World.h"
#include "../mbedTLS++/AesCfb128Decryptor.h" #include "../mbedTLS++/AesCfb128Decryptor.h"
#include "../mbedTLS++/AesCfb128Encryptor.h" #include "../mbedTLS++/AesCfb128Encryptor.h"