summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-09-08 15:39:40 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-09-08 15:39:40 +0200
commit9ab5627a393a0b178f13fbba2c39463cfe0675b8 (patch)
tree1f89501893f02a6e711e5a31868a8acdb4ca7de5 /src/Protocol/Protocol.h
parentd (diff)
parentShutdown connection when disconnect packet sent (#3999) (diff)
downloadcuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.gz
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.bz2
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.lz
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.xz
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.zst
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.zip
Diffstat (limited to 'src/Protocol/Protocol.h')
-rw-r--r--src/Protocol/Protocol.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 54c5b7223..235b60020 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -56,6 +56,78 @@ public:
virtual ~cProtocol() {}
+ /** A list of all outgoing packets */
+ enum eOutgoingPackets
+ {
+ sendAttachEntity = 0,
+ sendBlockAction,
+ sendBlockBreakAnim,
+ sendBlockChange,
+ sendBlockChanges,
+ sendCameraSetTo,
+ sendChatRaw,
+ sendCollectEntity,
+ sendDestroyEntity,
+ sendDifficulty,
+ sendDisconnectDuringLogin,
+ sendDisconnectDuringGame,
+ sendDisplayObjective,
+ sendEditSign,
+ sendEntityAnimation,
+ sendEntityEffect,
+ sendEntityEquipment,
+ sendEntityHeadLook,
+ sendEntityLook,
+ sendEntityMeta,
+ sendEntityProperties,
+ sendEntityRelMove,
+ sendEntityRelMoveLook,
+ sendEntityStatus,
+ sendEntityVelocity,
+ sendExperience,
+ sendExperienceOrb,
+ sendExplosion,
+ sendGameMode,
+ sendHealth,
+ sendInventorySlot,
+ sendJoinGame,
+ sendKeepAlive,
+ sendLeashEntity,
+ sendMapData,
+ sendPaintingSpawn,
+ sendParticleEffect,
+ sendPlayerAbilities,
+ sendPlayerList,
+ sendPlayerMaxSpeed,
+ sendPlayerMoveLook,
+ sendPlayerSpawn,
+ sendPluginMessage,
+ sendRemoveEntityEffect,
+ sendRespawn,
+ sendScoreboardObjective,
+ sendScoreUpdate,
+ sendSpawnObject,
+ sendSoundEffect,
+ sendSoundParticleEffect,
+ sendSpawnGlobalEntity,
+ sendSpawnMob,
+ sendSpawnPosition,
+ sendStatistics,
+ sendTabCompletion,
+ sendTeleportEntity,
+ sendTimeUpdate,
+ sendTitle,
+ sendUnloadChunk,
+ sendUpdateBlockEntity,
+ sendUpdateSign,
+ sendUseBed,
+ sendWeather,
+ sendWindowItems,
+ sendWindowClose,
+ sendWindowOpen,
+ sendWindowProperty
+ };
+
/** Called when client sends some data */
virtual void DataReceived(const char * a_Data, size_t a_Size) = 0;
@@ -165,6 +237,9 @@ protected:
/** Buffer for composing packet length (so that each cPacketizer instance doesn't allocate a new cPacketBuffer) */
cByteBuffer m_OutPacketLenBuffer;
+ /** Returns the protocol-specific packet ID given the protocol-agnostic packet enum (see PacketID.cpp for implementations) */
+ virtual UInt32 GetPacketId(eOutgoingPackets a_Packet) = 0;
+
/** A generic data-sending routine, all outgoing packet data needs to be routed through this so that descendants may override it. */
virtual void SendData(const char * a_Data, size_t a_Size) = 0;