From 42e57c121896818f9fbde5ddd9b7dbb5b2a267b1 Mon Sep 17 00:00:00 2001 From: B3n30 Date: Sun, 9 Jul 2017 12:26:03 +0200 Subject: Network: Enable sending and receiving chat messages --- src/network/room_member.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/network/room_member.h') diff --git a/src/network/room_member.h b/src/network/room_member.h index d23f5d4b6..693aa4e7f 100644 --- a/src/network/room_member.h +++ b/src/network/room_member.h @@ -24,6 +24,12 @@ struct WifiPacket { uint8_t channel; ///< WiFi channel where this frame was transmitted. }; +/// Represents a chat message. +struct ChatEntry { + std::string nickname; ///< Nickname of the client who sent this message. + std::string message; ///< Body of the message. +}; + /** * This is what a client [person joining a server] would use. * It also has to be used if you host a game yourself (You'd create both, a Room and a @@ -87,6 +93,12 @@ public: */ void SendWifiPacket(const WifiPacket& packet); + /** + * Sends a chat message to the room. + * @param message The contents of the message. + */ + void SendChatMessage(const std::string& message); + /** * Leaves the current room. */ -- cgit v1.2.3