From d2e42c33a05839866d8f7c812d7b9504bae82d3f Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Sat, 12 Aug 2023 14:53:50 +0200 Subject: [PATCH] change DelayedPacket name --- include/protocol/Protocol.h | 8 ++++---- include/protocol/packets/KeepAlivePacket.h | 2 +- include/protocol/packets/RemoveTowerPacket.h | 2 +- include/protocol/packets/UpdateMobStatesPacket.h | 2 +- include/protocol/packets/UpgradeTowerPacket.h | 2 +- include/protocol/packets/WorldAddTowerPacket.h | 2 +- src/protocol/PacketFactory.cpp | 4 ++-- src/protocol/Protocol.cpp | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/protocol/Protocol.h b/include/protocol/Protocol.h index 00fe55d..14a43c0 100644 --- a/include/protocol/Protocol.h +++ b/include/protocol/Protocol.h @@ -62,13 +62,13 @@ public: virtual bool IsTimed() const { return false; } }; -class TimedPacket : public Packet { +class DelayedPacket : public Packet { protected: std::uint64_t m_PacketTime = 69; public: - TimedPacket() {} - virtual ~TimedPacket() {} + DelayedPacket() {} + virtual ~DelayedPacket() {} virtual DataBuffer Serialize(bool packetID = true) const = 0; virtual void Deserialize(DataBuffer& data) = 0; @@ -84,7 +84,7 @@ public: }; typedef std::unique_ptr PacketPtr; -typedef std::unique_ptr TimedPacketPtr; +typedef std::unique_ptr DelayedPacketPtr; } // namespace protocol } // namespace td \ No newline at end of file diff --git a/include/protocol/packets/KeepAlivePacket.h b/include/protocol/packets/KeepAlivePacket.h index bc5c922..0baaf11 100644 --- a/include/protocol/packets/KeepAlivePacket.h +++ b/include/protocol/packets/KeepAlivePacket.h @@ -5,7 +5,7 @@ namespace td { namespace protocol { -class KeepAlivePacket : public TimedPacket { +class KeepAlivePacket : public Packet{ private: std::uint64_t m_AliveID; public: diff --git a/include/protocol/packets/RemoveTowerPacket.h b/include/protocol/packets/RemoveTowerPacket.h index 319a936..389fd0a 100644 --- a/include/protocol/packets/RemoveTowerPacket.h +++ b/include/protocol/packets/RemoveTowerPacket.h @@ -6,7 +6,7 @@ namespace td { namespace protocol { -class RemoveTowerPacket : public TimedPacket { +class RemoveTowerPacket : public DelayedPacket { private: game::TowerID m_TowerID; public: diff --git a/include/protocol/packets/UpdateMobStatesPacket.h b/include/protocol/packets/UpdateMobStatesPacket.h index ffceaf2..1319b0b 100644 --- a/include/protocol/packets/UpdateMobStatesPacket.h +++ b/include/protocol/packets/UpdateMobStatesPacket.h @@ -25,7 +25,7 @@ public: game::Direction GetMobDirection() const { return m_MobDirection; } }; -class UpdateMobStatesPacket : public TimedPacket { +class UpdateMobStatesPacket : public DelayedPacket { private: std::vector m_MobStates; public: diff --git a/include/protocol/packets/UpgradeTowerPacket.h b/include/protocol/packets/UpgradeTowerPacket.h index 558385d..e8c9495 100644 --- a/include/protocol/packets/UpgradeTowerPacket.h +++ b/include/protocol/packets/UpgradeTowerPacket.h @@ -6,7 +6,7 @@ namespace td { namespace protocol { -class UpgradeTowerPacket : public TimedPacket { +class UpgradeTowerPacket : public DelayedPacket { private: game::TowerID m_TowerID; game::TowerLevel m_TowerLevel; diff --git a/include/protocol/packets/WorldAddTowerPacket.h b/include/protocol/packets/WorldAddTowerPacket.h index 7212227..82a9181 100644 --- a/include/protocol/packets/WorldAddTowerPacket.h +++ b/include/protocol/packets/WorldAddTowerPacket.h @@ -6,7 +6,7 @@ namespace td { namespace protocol { -class WorldAddTowerPacket : public TimedPacket { +class WorldAddTowerPacket : public DelayedPacket { private: game::TowerID m_TowerID; std::int32_t m_TowerX, m_TowerY; diff --git a/src/protocol/PacketFactory.cpp b/src/protocol/PacketFactory.cpp index cecbf2a..6503bcf 100644 --- a/src/protocol/PacketFactory.cpp +++ b/src/protocol/PacketFactory.cpp @@ -53,8 +53,8 @@ PacketPtr CreatePacket(PacketType type, DataBuffer& buffer) { packet = packets[type](); - TimedPacket* timedPacket = reinterpret_cast(packet.get()); - timedPacket->SetPacketTime(packetTime); + DelayedPacket* delayedPacket = reinterpret_cast(packet.get()); + delayedPacket->SetPacketTime(packetTime); } else { packet = packets[type](); diff --git a/src/protocol/Protocol.cpp b/src/protocol/Protocol.cpp index 4f197dc..18a33d0 100644 --- a/src/protocol/Protocol.cpp +++ b/src/protocol/Protocol.cpp @@ -13,7 +13,7 @@ void Packet::WritePacketID(DataBuffer& data, bool packetID) const { data << GetID(); } -void TimedPacket::WritePacketID(DataBuffer& data, bool packetID) const { +void DelayedPacket::WritePacketID(DataBuffer& data, bool packetID) const { if (packetID) data << static_cast(GetID() | static_cast(0x80)) << m_PacketTime; }