group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ChatProtocol.cpp File Reference

Text-chat packet helpers. More...

#include "ChatProtocol.hpp"
#include "network/PacketType.hpp"
#include <algorithm>
#include <utility>
Include dependency graph for ChatProtocol.cpp:

Namespaces

namespace  net
namespace  net::chat

Functions

bool net::chat::isValidUtf8 (std::string_view text) noexcept
std::string net::chat::sanitizeUtf8 (std::string_view text)
std::vector< std::uint8_t > net::chat::encodeClientText (std::uint16_t clientSeq, std::string_view text)
std::vector< std::uint8_t > net::chat::encodeServerText (ClientId sender, std::uint32_t serverSeq, std::string_view text)
std::optional< ClientTextChatnet::chat::decodeClientText (std::span< const std::uint8_t > payload)
std::optional< ServerTextChatnet::chat::decodeServerText (std::span< const std::uint8_t > payload)

Detailed Description

Text-chat packet helpers.