mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-18 19:10:37 +00:00
engine: server: add rcon_enable cvar to control whether server should accept remote commands
This commit is contained in:
parent
b794f2fda0
commit
e1431e1040
@ -396,6 +396,7 @@ extern convar_t sv_maxunlag;
|
||||
extern convar_t sv_unlagpush;
|
||||
extern convar_t sv_unlagsamples;
|
||||
extern convar_t rcon_password;
|
||||
extern convar_t rcon_enable;
|
||||
extern convar_t sv_instancedbaseline;
|
||||
extern convar_t sv_background_freeze;
|
||||
extern convar_t sv_minupdaterate;
|
||||
|
@ -1013,6 +1013,9 @@ void SV_RemoteCommand( netadr_t from, sizebuf_t *msg )
|
||||
char remaining[1024];
|
||||
int i;
|
||||
|
||||
if( !rcon_enable.value )
|
||||
return;
|
||||
|
||||
Con_Printf( "Rcon from %s:\n%s\n", NET_AdrToString( from ), MSG_GetData( msg ) + 4 );
|
||||
Log_Printf( "Rcon: \"%s\" from \"%s\"\n", MSG_GetData( msg ) + 4, NET_AdrToString( from ));
|
||||
SV_BeginRedirect( from, RD_PACKET, outputbuf, sizeof( outputbuf ) - 16, SV_FlushRedirect );
|
||||
|
@ -30,6 +30,7 @@ CVAR_DEFINE_AUTO( sv_maxunlag, "0.5", 0, "max latency value which can be interpo
|
||||
CVAR_DEFINE_AUTO( sv_unlagpush, "0.0", 0, "interpolation bias for unlag time" );
|
||||
CVAR_DEFINE_AUTO( sv_unlagsamples, "1", 0, "max samples to interpolate" );
|
||||
CVAR_DEFINE_AUTO( rcon_password, "", 0, "remote connect password" );
|
||||
CVAR_DEFINE_AUTO( rcon_enable, "1", 0, "enable rcon" );
|
||||
CVAR_DEFINE_AUTO( sv_filterban, "1", 0, "filter banned users" );
|
||||
CVAR_DEFINE_AUTO( sv_cheats, "0", FCVAR_SERVER, "allow cheats on server" );
|
||||
CVAR_DEFINE_AUTO( sv_instancedbaseline, "1", 0, "allow to use instanced baselines to saves network overhead" );
|
||||
@ -909,6 +910,7 @@ void SV_Init( void )
|
||||
Cvar_RegisterVariable( &temp1 );
|
||||
|
||||
Cvar_RegisterVariable( &rcon_password );
|
||||
Cvar_RegisterVariable( &rcon_enable );
|
||||
Cvar_RegisterVariable( &sv_stepsize );
|
||||
Cvar_RegisterVariable( &sv_newunit );
|
||||
Cvar_RegisterVariable( &hostname );
|
||||
|
Loading…
x
Reference in New Issue
Block a user