|
R-Type
Distributed multiplayer game engine in C++
|
All game messages for R-Type network protocol. More...
Namespaces | |
| namespace | C2S |
| Client-to-Server messages. | |
| namespace | Connection |
| namespace | S2C |
| Server-to-Client messages. | |
| namespace | Shared |
All game messages for R-Type network protocol.
Architecture:
Each message class provides:
Usage example:
#include "Messages/Messages.hpp" using namespace RType::Messages;
// Create and send a message C2S::PlayerInput input(123, {Shared::Action::MoveUp, Shared::Action::Shoot}); auto payload = input.serialize();
// Wrap in network protocol auto packet = NetworkMessages::createMessage( NetworkMessages::MessageType::C2S_PLAYER_INPUT, payload );
// Send packet over network...
// Receive and deserialize auto type = NetworkMessages::getMessageType(receivedPacket); auto payload = NetworkMessages::getPayload(receivedPacket); auto input = C2S::PlayerInput::deserialize(payload);