working message factory
This commit is contained in:
13
include/examples/DisconnectPacket.h
Normal file
13
include/examples/DisconnectPacket.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <sp/default/DefaultPacket.h>
|
||||
#include <sp/protocol/Field.h>
|
||||
#include <sp/protocol/MessageBase.h>
|
||||
|
||||
enum DisconnectPacketFields {
|
||||
Reason = 0
|
||||
};
|
||||
|
||||
using DisconnectFields = std::tuple<std::string /*Reason*/>;
|
||||
|
||||
DeclarePacket(Disconnect);
|
||||
@@ -1,11 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
enum PacketId {
|
||||
KeepAlive
|
||||
KeepAlive = 0,
|
||||
Disconnect,
|
||||
};
|
||||
|
||||
#include <examples/KeepAlivePacket.h>
|
||||
#include <examples/DisconnectPacket.h>
|
||||
|
||||
using AllPackets = std::tuple<KeepAlivePacket>;
|
||||
// they must be in the same order !
|
||||
using AllPackets = std::tuple<KeepAlivePacket, DisconnectPacket>;
|
||||
|
||||
#include <sp/default/DefaultPacketHandler.h>
|
||||
#include <sp/default/DefaultPacketHandler.h>
|
||||
#include <sp/default/DefaultPacketFactory.h>
|
||||
Reference in New Issue
Block a user