Browse Source

engine: server: add sv_log_outofband cvar that controls whether connectionless packets should be printed or not

pull/2/head
Alibek Omarov 1 year ago
parent
commit
c7d748e8df
  1. 1
      engine/server/server.h
  2. 4
      engine/server/sv_client.c
  3. 2
      engine/server/sv_main.c

1
engine/server/server.h

@ -472,6 +472,7 @@ extern convar_t sv_userinfo_penalty_time; @@ -472,6 +472,7 @@ extern convar_t sv_userinfo_penalty_time;
extern convar_t sv_userinfo_penalty_multiplier;
extern convar_t sv_userinfo_penalty_attempts;
extern convar_t sv_fullupdate_penalty_time;
extern convar_t sv_log_outofband;
//===========================================================
//

4
engine/server/sv_client.c

@ -3146,7 +3146,9 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) @@ -3146,7 +3146,9 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
Cmd_TokenizeString( args );
pcmd = Cmd_Argv( 0 );
Con_Reportf( "SV_ConnectionlessPacket: %s : %s\n", NET_AdrToString( from ), pcmd );
if( sv_log_outofband.value )
Con_Reportf( "SV_ConnectionlessPacket: %s : %s\n", NET_AdrToString( from ), pcmd );
if( !Q_strcmp( pcmd, "ping" )) SV_Ping( from );
else if( !Q_strcmp( pcmd, "ack" )) SV_Ack( from );

2
engine/server/sv_main.c

@ -145,6 +145,7 @@ CVAR_DEFINE_AUTO( sv_userinfo_penalty_time, "0.3", FCVAR_ARCHIVE, "initial penal @@ -145,6 +145,7 @@ CVAR_DEFINE_AUTO( sv_userinfo_penalty_time, "0.3", FCVAR_ARCHIVE, "initial penal
CVAR_DEFINE_AUTO( sv_userinfo_penalty_multiplier, "2", FCVAR_ARCHIVE, "penalty time multiplier" );
CVAR_DEFINE_AUTO( sv_userinfo_penalty_attempts, "4", FCVAR_ARCHIVE, "if max attempts count was exceeded, penalty time will be increased" );
CVAR_DEFINE_AUTO( sv_fullupdate_penalty_time, "1", FCVAR_ARCHIVE, "allow fullupdate command only once in this timewindow (set 0 to disable)" );
CVAR_DEFINE_AUTO( sv_log_outofband, "0", FCVAR_ARCHIVE, "log out of band messages, can be useful for server admins and for engine debugging" );
//============================================================================
/*
@ -939,6 +940,7 @@ void SV_Init( void ) @@ -939,6 +940,7 @@ void SV_Init( void )
Cvar_RegisterVariable( &sv_userinfo_penalty_multiplier );
Cvar_RegisterVariable( &sv_userinfo_penalty_attempts );
Cvar_RegisterVariable( &sv_fullupdate_penalty_time );
Cvar_RegisterVariable( &sv_log_outofband );
// when we in developer-mode automatically turn cheats on
if( host_developer.value ) Cvar_SetValue( "sv_cheats", 1.0f );

Loading…
Cancel
Save