add packets
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
#include <td/common/NonCopyable.h>
|
||||
#include <td/protocol/packet/PacketData.h>
|
||||
|
||||
#include <sp/common/GenericHandler.h>
|
||||
#include <sp/protocol/ConcreteMessage.h>
|
||||
#include <sp/protocol/MessageBase.h>
|
||||
#include <sp/protocol/MessageDispatcher.h>
|
||||
#include <sp/protocol/MessageFactory.h>
|
||||
#include <sp/common/GenericHandler.h>
|
||||
|
||||
namespace td {
|
||||
namespace protocol {
|
||||
@@ -24,10 +24,12 @@ enum class PacketID : std::uint8_t {
|
||||
KeepAlive,
|
||||
LockSteps,
|
||||
LoggingSuccess,
|
||||
PlaceTower,
|
||||
PlayerJoin,
|
||||
PlayerLeave,
|
||||
PlayerLogin,
|
||||
PredictCommand,
|
||||
SpawnTroop,
|
||||
WorldHeader,
|
||||
WorldData,
|
||||
};
|
||||
@@ -49,18 +51,21 @@ using DisconnectPacket = PacketMessage<pdata::Disconnect, PacketID::Disconnect>;
|
||||
using KeepAlivePacket = PacketMessage<pdata::KeepAlive, PacketID::KeepAlive>;
|
||||
using LockStepsPacket = PacketMessage<pdata::LockSteps, PacketID::LockSteps>;
|
||||
using LoggingSuccessPacket = PacketMessage<pdata::LoggingSuccess, PacketID::LoggingSuccess>;
|
||||
using PlaceTowerPacket = PacketMessage<pdata::PlaceTower, PacketID::PlaceTower>;
|
||||
using PlayerJoinPacket = PacketMessage<pdata::PlayerJoin, PacketID::PlayerJoin>;
|
||||
using PlayerLeavePacket = PacketMessage<pdata::PlayerLeave, PacketID::PlayerLeave>;
|
||||
using PlayerLoginPacket = PacketMessage<pdata::PlayerLogin, PacketID::PlayerLogin>;
|
||||
using PredictCommandPacket = PacketMessage<pdata::PredictCommand, PacketID::PredictCommand>;
|
||||
using SpawnTroopPacket = PacketMessage<pdata::SpawnTroop, PacketID::SpawnTroop>;
|
||||
using WorldHeaderPacket = PacketMessage<pdata::WorldHeader, PacketID::WorldHeader>;
|
||||
using WorldDataPacket = PacketMessage<pdata::WorldData, PacketID::WorldData>;
|
||||
|
||||
} // namespace packets
|
||||
|
||||
using AllPackets = std::tuple<packets::BeginGamePacket, packets::ChatMessagePacket, packets::DisconnectPacket,
|
||||
packets::KeepAlivePacket, packets::LockStepsPacket, packets::LoggingSuccessPacket, packets::PlayerJoinPacket,
|
||||
packets::PlayerLeavePacket, packets::PlayerLoginPacket, packets::PredictCommandPacket, packets::WorldHeaderPacket, packets::WorldDataPacket>;
|
||||
packets::KeepAlivePacket, packets::LockStepsPacket, packets::LoggingSuccessPacket, packets::PlaceTowerPacket,
|
||||
packets::PlayerJoinPacket, packets::PlayerLeavePacket, packets::PlayerLoginPacket, packets::PredictCommandPacket,
|
||||
packets::SpawnTroopPacket, packets::WorldHeaderPacket, packets::WorldDataPacket>;
|
||||
|
||||
class PacketHandler : public sp::GenericHandler<AllPackets> {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user