ConnectX 3.0
ConnectX Game Suite
Loading...
Searching...
No Matches
messagetype.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5
6#ifdef ERROR
7#undef ERROR
8#endif
9
13enum class MessageType : uint8_t
14{
15 // Connection management
16 REQ_CONNECT = 0x01,
17 RES_CONNECT = 0x02,
18 DISCONNECT = 0x03,
19 HEARTBEAT = 0x04,
20
21 // Game actions
22 MAKE_MOVE = 0x10,
23 MOVE_RESULT = 0x11,
24 GAME_STATE_UPDATE = 0x12,
25
26 // Lobby/matchmaking
27 REQ_CREATE_GAME = 0x20,
28 RES_CREATE_GAME = 0x21,
29 REQ_LIST_GAMES = 0x22,
30 RES_LIST_GAMES = 0x23,
31 REQ_JOIN_GAME = 0x24,
32 RES_JOIN_GAME = 0x25,
33
34 // Error handling
35 ERROR = 0xFF
36};
37
41std::string messageTypeToString(MessageType type);
MessageType
Definition messagetype.hpp:14
std::string messageTypeToString(MessageType type)
Definition messagetype.cpp:3