From 905f4964745730d37d62a7a93e090931dcd530f5 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:56:14 +0100 Subject: [PATCH] NetCon: add new net console types Will be used to replace the current frame prefix header. --- src/engine/CMakeLists.txt | 2 ++ src/netconsole/CMakeLists.txt | 4 ++++ src/public/netcon/INetCon.h | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 src/public/netcon/INetCon.h diff --git a/src/engine/CMakeLists.txt b/src/engine/CMakeLists.txt index bfe521c7..5a4d69c3 100644 --- a/src/engine/CMakeLists.txt +++ b/src/engine/CMakeLists.txt @@ -229,6 +229,8 @@ add_sources( SOURCE_GROUP "Public" "${ENGINE_SOURCE_DIR}/public/networkvar.h" "${ENGINE_SOURCE_DIR}/public/playerstate.h" + "${ENGINE_SOURCE_DIR}/public/netcon/INetCon.h" + # These probably need to go to 'bsplib' if we ever create that project. "${ENGINE_SOURCE_DIR}/public/bspflags.h" "${ENGINE_SOURCE_DIR}/public/bspfile.h" diff --git a/src/netconsole/CMakeLists.txt b/src/netconsole/CMakeLists.txt index e978455b..3b3f2e3e 100644 --- a/src/netconsole/CMakeLists.txt +++ b/src/netconsole/CMakeLists.txt @@ -24,6 +24,10 @@ add_sources( SOURCE_GROUP "Engine" "${ENGINE_SOURCE_DIR}/engine/shared/shared_rcon.h" ) +add_sources( SOURCE_GROUP "Public" + "${ENGINE_SOURCE_DIR}/public/netcon/INetCon.h" +) + add_sources( SOURCE_GROUP "Windows" "${ENGINE_SOURCE_DIR}/windows/console.cpp" "${ENGINE_SOURCE_DIR}/windows/console.h" diff --git a/src/public/netcon/INetCon.h b/src/public/netcon/INetCon.h new file mode 100644 index 00000000..7b1bca29 --- /dev/null +++ b/src/public/netcon/INetCon.h @@ -0,0 +1,20 @@ +//===========================================================================// +// +// Purpose: Net console types +// +//===========================================================================// +#ifndef INETCON_H +#define INETCON_H + +#define RCON_FRAME_MAGIC ('R'+('C'<<8)+('o'<<16)+('n'<<24)) +#define RCON_FRAME_MAX_SIZE 1024*1024 // Max size of envelope and its payload. + +// Wire struct for each individual net console frame. Fields are transmitted in +// network byte order and must be flipped to platform's endianness on receive. +struct NetConFrameHeader_s +{ + u32 magic; + u32 length; +}; + +#endif // INETCON_H