From 30eb23ffe5f7b9e8c3b4267457d0aa3bd02665e7 Mon Sep 17 00:00:00 2001 From: hovertank3d Date: Mon, 23 Feb 2026 23:17:56 +0100 Subject: implement `connect`, `disconnect` and `accept` --- include/net/types.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/net') diff --git a/include/net/types.hpp b/include/net/types.hpp index b9453d6..5301021 100644 --- a/include/net/types.hpp +++ b/include/net/types.hpp @@ -72,6 +72,25 @@ struct vec2 { T y; }; +// NetMessages + +struct connect { + static constexpr uint8_t packet_id = 1; + + std::string version; +}; + +struct disconnect { + static constexpr uint8_t packet_id = 2; + + nstring reason; +}; + +struct accept { + uint8_t slot; + uint8_t server_flags = 0; +}; + inline nstring operator""_ns(const char* str, std::size_t) { return nstring{nstring::Literal, str}; @@ -79,3 +98,5 @@ inline nstring operator""_ns(const char* str, std::size_t) } } + +using net::packet::operator""_ns; -- cgit v1.2.3