|
R-Type
Networked shoot'em up built on Aegis2D
|
TCP messages of the session (RFC section 3.2): encoding, decoding and name rules; those of the rooms are in rooms.hpp, those of the chat in chat.hpp, those of the scoreboard in scores.hpp. More...
#include <cstddef>#include <cstdint>#include <optional>#include <span>#include <string>#include <string_view>#include <vector>Go to the source code of this file.
Classes | |
| struct | rtype::LoginRequest |
Content of a LoginRequest. More... | |
| struct | rtype::LoginAccepted |
Content of a LoginAccepted. More... | |
Namespaces | |
| namespace | rtype |
| R-Type game code, built on the Aegis2D engine. | |
Functions | |
| std::string_view | rtype::to_string (LoginRejection reason) noexcept |
| Short name of a rejection, for logs. | |
| bool | rtype::valid_text (std::string_view text, std::size_t max_size) noexcept |
Tells whether a text is 1 to max_size bytes of valid UTF-8 without control characters, as player names and chat texts must be. | |
| bool | rtype::valid_player_name (std::string_view name) noexcept |
Tells whether a name follows the rules of LoginRequest. | |
| std::optional< TcpKind > | rtype::kind_of (std::span< const std::byte > message) noexcept |
| Kind of a TCP message. | |
| std::optional< LoginRequest > | rtype::read_login_request (std::span< const std::byte > message) |
Reads a LoginRequest. | |
| std::optional< LoginAccepted > | rtype::read_login_accepted (std::span< const std::byte > message) noexcept |
Reads a LoginAccepted. | |
| std::optional< std::uint8_t > | rtype::read_login_rejected (std::span< const std::byte > message) noexcept |
Reads a LoginRejected. | |
| std::optional< std::uint8_t > | rtype::read_logout (std::span< const std::byte > message) noexcept |
Reads a Logout. | |
| std::vector< std::byte > | rtype::write_login_request (const LoginRequest &request) |
Encodes a LoginRequest. | |
| std::vector< std::byte > | rtype::write_login_accepted (const LoginAccepted &accepted) |
Encodes a LoginAccepted. | |
| std::vector< std::byte > | rtype::write_login_rejected (LoginRejection reason) |
Encodes a LoginRejected. | |
| std::vector< std::byte > | rtype::write_logout (LogoutReason reason) |
Encodes a Logout. | |
Variables | |
| constexpr std::uint8_t | rtype::protocol_version = 1 |
Protocol version the server speaks, in LoginRequest and in the UDP header. | |
| constexpr std::size_t | rtype::max_name_size = 16 |
| Longest player name, in bytes of UTF-8. | |
TCP messages of the session (RFC section 3.2): encoding, decoding and name rules; those of the rooms are in rooms.hpp, those of the chat in chat.hpp, those of the scoreboard in scores.hpp.