NetCon: add new net console types

Will be used to replace the current frame prefix header.
This commit is contained in:
Kawe Mazidjatari 2025-02-09 16:56:14 +01:00
parent 5d7c94ae2f
commit 905f496474
3 changed files with 26 additions and 0 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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