Skip to content

Commit

Permalink
feat(protocol): add Spawn Window related serializables
Browse files Browse the repository at this point in the history
  • Loading branch information
Insineer committed Sep 21, 2019
1 parent 1ed41ad commit 37dcc94
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SharedLibrary/Sources/Shared/Network/ISerializable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ std::unique_ptr<ISerializable> CreateSerializableById(uint32_t id) {
DECLARE_SER(SendChatMessageCommand)
DECLARE_SER(UIInputCommand)
DECLARE_SER(UITriggerCommand)
DECLARE_SER(SpawnWindowSearchCommand)
DECLARE_SER(SpawnWindowSpawnCommand)
DECLARE_SER(CallVerbCommand)
DECLARE_SER(DisconnectionCommand)
}
Expand All @@ -51,6 +53,8 @@ std::unique_ptr<ISerializable> CreateSerializableById(uint32_t id) {
DECLARE_SER(OverlayUpdateCommand)
DECLARE_SER(OverlayResetCommand)
DECLARE_SER(OpenWindowCommand)
DECLARE_SER(OpenSpawnWindowCommand)
DECLARE_SER(UpdateSpawnWindowCommand)
DECLARE_SER(UpdateWindowCommand)
DECLARE_SER(AddChatMessageCommand)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ DEFINE_SERIALIZABLE(UITriggerCommand, Command)
}
DEFINE_SERIALIZABLE_END

DEFINE_SERIALIZABLE(SpawnWindowSearchCommand, Command)
std::string searchBuffer;

void Serialize(uf::Archive &ar) override {
Command::Serialize(ar);
ar & searchBuffer;
}
DEFINE_SERIALIZABLE_END

DEFINE_SERIALIZABLE(SpawnWindowSpawnCommand, Command)
std::string typeKey;

void Serialize(uf::Archive &ar) override {
Command::Serialize(ar);
ar & typeKey;
}
DEFINE_SERIALIZABLE_END

DEFINE_SERIALIZABLE(CallVerbCommand, Command)
std::string verb;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ DEFINE_SERIALIZABLE(UpdateWindowCommand, Command)
}
DEFINE_SERIALIZABLE_END

DEFINE_PURE_SERIALIZABLE(OpenSpawnWindowCommand, Command)

DEFINE_SERIALIZABLE(UpdateSpawnWindowCommand, Command)
std::vector<network::protocol::ObjectType> types;

void Serialize(uf::Archive &ar) override {
uf::ISerializable::Serialize(ar);
ar & types;
}
DEFINE_SERIALIZABLE_END

DEFINE_SERIALIZABLE(AddChatMessageCommand, Command)
std::string message;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
namespace network {
namespace protocol {

DEFINE_SERIALIZABLE(ObjectType, uf::ISerializable)
std::string typeKey;
std::string typeName;
std::string name;
uint32_t sprite;
std::string description;

void Serialize(uf::Archive &ar) override {
uf::ISerializable::Serialize(ar);
ar & typeKey;
ar & typeName;
ar & name;
ar & sprite;
ar & description;
}
DEFINE_SERIALIZABLE_END

DEFINE_SERIALIZABLE(ObjectInfo, uf::ISerializable)
uint32_t id;
std::string name;
Expand Down

0 comments on commit 37dcc94

Please sign in to comment.