summaryrefslogtreecommitdiffstats
path: root/src/network/room.h
diff options
context:
space:
mode:
authorWeiyi Wang <wwylele@gmail.com>2017-07-17 16:08:02 +0200
committerGitHub <noreply@github.com>2017-07-17 16:08:02 +0200
commit924215a41fc3b1cfe16ae622a14a4bc856b5972e (patch)
treec0407aad38f63520e402ce713bf7a73fa6397f11 /src/network/room.h
parentMerge pull request #2829 from MerryMage/check_submodules_present (diff)
parentNetwork: Changed timeout for receiving packets to 100ms (diff)
downloadyuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.tar
yuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.tar.gz
yuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.tar.bz2
yuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.tar.lz
yuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.tar.xz
yuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.tar.zst
yuzu-924215a41fc3b1cfe16ae622a14a4bc856b5972e.zip
Diffstat (limited to 'src/network/room.h')
-rw-r--r--src/network/room.h26
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: