change DelayedPacket name
This commit is contained in:
@@ -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<Packet> PacketPtr;
|
||||
typedef std::unique_ptr<TimedPacket> TimedPacketPtr;
|
||||
typedef std::unique_ptr<DelayedPacket> DelayedPacketPtr;
|
||||
|
||||
} // namespace protocol
|
||||
} // namespace td
|
||||
@@ -5,7 +5,7 @@
|
||||
namespace td {
|
||||
namespace protocol {
|
||||
|
||||
class KeepAlivePacket : public TimedPacket {
|
||||
class KeepAlivePacket : public Packet{
|
||||
private:
|
||||
std::uint64_t m_AliveID;
|
||||
public:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace td {
|
||||
namespace protocol {
|
||||
|
||||
class RemoveTowerPacket : public TimedPacket {
|
||||
class RemoveTowerPacket : public DelayedPacket {
|
||||
private:
|
||||
game::TowerID m_TowerID;
|
||||
public:
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
game::Direction GetMobDirection() const { return m_MobDirection; }
|
||||
};
|
||||
|
||||
class UpdateMobStatesPacket : public TimedPacket {
|
||||
class UpdateMobStatesPacket : public DelayedPacket {
|
||||
private:
|
||||
std::vector<MobState> m_MobStates;
|
||||
public:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -53,8 +53,8 @@ PacketPtr CreatePacket(PacketType type, DataBuffer& buffer) {
|
||||
|
||||
packet = packets[type]();
|
||||
|
||||
TimedPacket* timedPacket = reinterpret_cast<TimedPacket*>(packet.get());
|
||||
timedPacket->SetPacketTime(packetTime);
|
||||
DelayedPacket* delayedPacket = reinterpret_cast<DelayedPacket*>(packet.get());
|
||||
delayedPacket->SetPacketTime(packetTime);
|
||||
|
||||
} else {
|
||||
packet = packets[type]();
|
||||
|
||||
@@ -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<std::uint8_t>(GetID() | static_cast<std::uint8_t>(0x80)) << m_PacketTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user