diff options
author | Lane Kolbly <lane@rscheme.org> | 2017-09-02 18:46:57 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2017-09-02 18:46:57 +0200 |
commit | aebfbfb8c8d623ded8d409d29983a5e871a475bc (patch) | |
tree | 7c2d46d7c4dceb1aa11bdd905739a54f3846a167 /src/Protocol/PacketID.cpp | |
parent | Revert "Replace ItemCallbacks with lambdas (#3948)" (diff) | |
download | cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.tar cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.tar.gz cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.tar.bz2 cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.tar.lz cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.tar.xz cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.tar.zst cuberite-aebfbfb8c8d623ded8d409d29983a5e871a475bc.zip |
Diffstat (limited to 'src/Protocol/PacketID.cpp')
-rw-r--r-- | src/Protocol/PacketID.cpp | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/src/Protocol/PacketID.cpp b/src/Protocol/PacketID.cpp new file mode 100644 index 000000000..6bb8379dd --- /dev/null +++ b/src/Protocol/PacketID.cpp @@ -0,0 +1,182 @@ +#include "Globals.h" + +#include "Protocol_1_9.h" +#include "Protocol_1_12.h" + + + + + +UInt32 cProtocol_1_9_0::GetPacketId(eOutgoingPackets a_Packet) +{ + switch (a_Packet) + { + case sendAttachEntity: return 0x40; + case sendBlockAction: return 0x0a; + case sendBlockBreakAnim: return 0x08; + case sendBlockChange: return 0x0b; + case sendBlockChanges: return 0x10; + case sendCameraSetTo: return 0x36; + case sendChatRaw: return 0x0f; + case sendCollectEntity: return 0x49; + case sendDestroyEntity: return 0x30; + case sendDifficulty: return 0x0d; + case sendDisconnectDuringGame: return 0x1a; + case sendDisconnectDuringLogin: return 0x0; + case sendDisplayObjective: return 0x38; + case sendEditSign: return 0x2a; + case sendEntityAnimation: return 0x06; + case sendEntityEffect: return 0x4c; + case sendEntityEquipment: return 0x3c; + case sendEntityHeadLook: return 0x34; + case sendEntityLook: return 0x27; + case sendEntityMeta: return 0x39; + case sendEntityProperties: return 0x4b; + case sendEntityRelMove: return 0x25; + case sendEntityRelMoveLook: return 0x26; + case sendEntityStatus: return 0x1b; + case sendEntityVelocity: return 0x3b; + case sendExperience: return 0x3d; + case sendExperienceOrb: return 0x01; + case sendExplosion: return 0x1c; + case sendGameMode: return 0x1e; + case sendHealth: return 0x3e; + case sendInventorySlot: return 0x16; + case sendJoinGame: return 0x23; + case sendKeepAlive: return 0x1f; + case sendLeashEntity: return 0x3a; + case sendMapData: return 0x24; + case sendPaintingSpawn: return 0x04; + case sendParticleEffect: return 0x22; + case sendPlayerAbilities: return 0x2b; + case sendPlayerList: return 0x2d; + case sendPlayerMaxSpeed: return 0x4b; + case sendPlayerMoveLook: return 0x2e; + case sendPlayerSpawn: return 0x05; + case sendPluginMessage: return 0x18; + case sendRemoveEntityEffect: return 0x31; + case sendRespawn: return 0x33; + case sendScoreboardObjective: return 0x3f; + case sendScoreUpdate: return 0x42; + case sendSpawnGlobalEntity: return 0x02; + case sendSpawnObject: return 0x00; + case sendSpawnPosition: return 0x43; + case sendSoundEffect: return 0x19; + case sendSoundParticleEffect: return 0x21; + case sendSpawnMob: return 0x03; + case sendStatistics: return 0x07; + case sendTabCompletion: return 0x0e; + case sendTeleportEntity: return 0x4a; + case sendTimeUpdate: return 0x44; + case sendTitle: return 0x45; + case sendUnloadChunk: return 0x1d; + case sendUpdateBlockEntity: return 0x09; + case sendUpdateSign: return 0x46; + case sendUseBed: return 0x2f; + case sendWeather: return 0x1e; + case sendWindowClose: return 0x12; + case sendWindowItems: return 0x14; + case sendWindowOpen: return 0x13; + case sendWindowProperty: return 0x15; + } + LOGWARNING("Retrieving packet ID for unknown packet type %d!", a_Packet); + return 0; +} + + + + + +UInt32 cProtocol_1_9_4::GetPacketId(eOutgoingPackets a_Packet) +{ + switch (a_Packet) + { + case sendCollectEntity: return 0x48; + case sendEntityEffect: return 0x4b; + case sendEntityProperties: return 0x4a; + case sendPlayerMaxSpeed: return 0x4a; + case sendTeleportEntity: return 0x49; + + default: return super::GetPacketId(a_Packet); + } +} + + + + + +UInt32 cProtocol_1_12::GetPacketId(eOutgoingPackets a_Packet) +{ + switch (a_Packet) + { + case sendAttachEntity: return 0x42; + case sendCameraSetTo: return 0x38; + case sendCollectEntity: return 0x4a; + case sendDestroyEntity: return 0x31; + case sendDisplayObjective: return 0x3a; + case sendEntityEffect: return 0x4e; + case sendEntityEquipment: return 0x3e; + case sendEntityHeadLook: return 0x35; + case sendEntityLook: return 0x28; + case sendEntityMeta: return 0x3b; + case sendEntityProperties: return 0x4d; + case sendEntityRelMove: return 0x26; + case sendEntityRelMoveLook: return 0x27; + case sendEntityVelocity: return 0x3d; + case sendExperience: return 0x3f; + case sendHealth: return 0x40; + case sendLeashEntity: return 0x3c; + case sendPlayerMaxSpeed: return 0x4d; + case sendRemoveEntityEffect: return 0x32; + case sendRespawn: return 0x34; + case sendScoreboardObjective: return 0x41; + case sendScoreUpdate: return 0x44; + case sendSpawnPosition: return 0x45; + case sendTeleportEntity: return 0x4b; + case sendTimeUpdate: return 0x46; + case sendTitle: return 0x47; + case sendUpdateBlockEntity: return 0x09; + + default: return super::GetPacketId(a_Packet); + } +} + + + + + +UInt32 cProtocol_1_12_1::GetPacketId(eOutgoingPackets a_Packet) +{ + switch (a_Packet) + { + case sendAttachEntity: return 0x43; + case sendCameraSetTo: return 0x39; + case sendCollectEntity: return 0x4b; + case sendDestroyEntity: return 0x32; + case sendDisplayObjective: return 0x3b; + case sendEntityEffect: return 0x4f; + case sendEntityEquipment: return 0x3f; + case sendEntityHeadLook: return 0x36; + case sendEntityMeta: return 0x3c; + case sendEntityProperties: return 0x4e; + case sendEntityVelocity: return 0x3e; + case sendExperience: return 0x40; + case sendHealth: return 0x41; + case sendLeashEntity: return 0x3d; + case sendPlayerList: return 0x2e; + case sendPlayerAbilities: return 0x2c; + case sendPlayerMaxSpeed: return 0x4e; + case sendPlayerMoveLook: return 0x2f; + case sendRemoveEntityEffect: return 0x33; + case sendRespawn: return 0x35; + case sendScoreboardObjective: return 0x42; + case sendScoreUpdate: return 0x45; + case sendSpawnPosition: return 0x46; + case sendUseBed: return 0x30; + case sendTeleportEntity: return 0x4c; + case sendTimeUpdate: return 0x47; + case sendTitle: return 0x48; + + default: return super::GetPacketId(a_Packet); + } +} |