22 using Clock = std::chrono::steady_clock;
37 void refused(std::uint8_t reason, Clock::time_point now);
41 void prune(Clock::time_point now);
45 [[nodiscard]]
const std::vector<PlayerNotice>&
shown() const noexcept;
TCP messages of the chat (RFC section 3.8): encoding, decoding and text rules.
The chat messages to show, newest last, each for shown_for.
Definition chat_log.hpp:19
void clear() noexcept
Forgets every line, for a new session.
void prune(Clock::time_point now)
Drops the lines whose time is over.
static constexpr std::chrono::seconds shown_for
How long a line stays.
Definition chat_log.hpp:24
const std::vector< PlayerNotice > & shown() const noexcept
Lines to show, oldest first.
void refused(std::uint8_t reason, Clock::time_point now)
Adds the reason a message of this client was not relayed.
bool add(const ChatMessage &message, Clock::time_point now)
Adds a message relayed by the server.
static constexpr std::size_t max_shown
Most lines shown at once: a new one pushes out the oldest.
Definition chat_log.hpp:26
std::chrono::steady_clock Clock
Clock of the lines.
Definition chat_log.hpp:22
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16
std::string chat_rejection_text(std::uint8_t reason)
Sentence telling why a message was not sent.
The messages shown when a player joins or leaves the game.
Content of a ChatMessage.
Definition chat.hpp:38
A message about a player, shown for a few seconds.
Definition player_notices.hpp:19