From 2d546ccbf785123ae2b172ca0b069f891be0f7ce Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 18 Oct 2024 03:13:43 +0300 Subject: [PATCH] engine: implement CL_MsgInfo for dedicated server --- engine/common/dedicated.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/engine/common/dedicated.c b/engine/common/dedicated.c index 62bd98a9..db883f4d 100644 --- a/engine/common/dedicated.c +++ b/engine/common/dedicated.c @@ -16,9 +16,39 @@ GNU General Public License for more details. #include "common.h" #include "xash3d_mathlib.h" #include "ref_api.h" +#include "server.h" ref_globals_t refState; +const char *CL_MsgInfo( int cmd ) +{ + static string sz; + + Q_strncpy( sz, "???", sizeof( sz )); + + if( cmd >= 0 && cmd <= svc_lastmsg ) + { + // get engine message name + const char *svc_string = svc_strings[cmd]; + + Q_strncpy( sz, svc_string, sizeof( sz )); + } + else if( cmd > svc_lastmsg && cmd <= ( svc_lastmsg + MAX_USER_MESSAGES )) + { + int i; + + for( i = 0; i < MAX_USER_MESSAGES; i++ ) + { + if( svgame.msg[i].number == cmd ) + { + Q_strncpy( sz, svgame.msg[i].name, sizeof( sz )); + break; + } + } + } + return sz; +} + void CL_ProcessFile( qboolean successfully_received, const char *filename ) {