R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
StartMatchmaking.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** File description:
4** StartMatchmaking.hpp - Start matchmaking
5*/
6
7#pragma once
8
9#include <capnp/message.h>
10#include <capnp/serialize.h>
11#include <vector>
12#include "schemas/c2s_messages.capnp.h"
13
14namespace RType::Messages::C2S {
15
17 public:
18 StartMatchmaking() = default;
19
20 [[nodiscard]] std::vector<uint8_t> serialize() const {
21 capnp::MallocMessageBuilder message;
22 message.initRoot<::StartMatchmaking>();
23
24 auto bytes = capnp::messageToFlatArray(message);
25 auto byteArray = bytes.asBytes();
26 return std::vector<uint8_t>(byteArray.begin(), byteArray.end());
27 }
28
29 static StartMatchmaking deserialize(const std::vector<uint8_t> & /*data*/) {
30 return StartMatchmaking();
31 }
32 };
33
34} // namespace RType::Messages::C2S
static StartMatchmaking deserialize(const std::vector< uint8_t > &)
std::vector< uint8_t > serialize() const
Client-to-Server messages.