diff options
Diffstat (limited to 'src/network/room.h')
-rw-r--r-- | src/network/room.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/network/room.h b/src/network/room.h index 70c64d5f1..54cccf0ae 100644 --- a/src/network/room.h +++ b/src/network/room.h @@ -4,13 +4,15 @@ #pragma once -#include <atomic> +#include <array> #include <memory> #include <string> #include "common/common_types.h" namespace Network { +constexpr u32 network_version = 1; ///< The version of this Room and RoomMember + constexpr u16 DefaultRoomPort = 1234; constexpr size_t NumChannels = 1; // Number of channels used for the connection @@ -19,6 +21,28 @@ struct RoomInformation { u32 member_slots; ///< Maximum number of members in this room }; +using MacAddress = std::array<u8, 6>; +/// A special MAC address that tells the room we're joining to assign us a MAC address +/// automatically. +const MacAddress NoPreferredMac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + +// 802.11 broadcast MAC address +constexpr MacAddress BroadcastMac = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; + +// The different types of messages that can be sent. The first byte of each packet defines the type +enum RoomMessageTypes : u8 { + IdJoinRequest = 1, + IdJoinSuccess, + IdRoomInformation, + IdSetGameName, + IdWifiPacket, + IdChatMessage, + IdNameCollision, + IdMacCollision, + IdVersionMismatch, + IdCloseRoom +}; + /// This is what a server [person creating a server] would use. class Room final { public: |