Added mp_allow_point_servercommand to disable point_servercommand entities.

Due to a high risk of abuse, it is gated by the mp_allow_point_servercommand console variable.
This commit is contained in:
s1lent 2019-04-09 17:25:20 +07:00
parent 1722f883a1
commit a31be1d18e
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
5 changed files with 21 additions and 0 deletions

View File

@ -50,6 +50,8 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_item_staytime | 300 | - | - | Time to remove item that have been dropped from the players. | | mp_item_staytime | 300 | - | - | Time to remove item that have been dropped from the players. |
| mp_legacy_bombtarget_touch | 1 | 0 | 1 | Legacy func_bomb_target touch. New one is more strict. <br/>`0` New behavior<br/>`1` Legacy behavior| | mp_legacy_bombtarget_touch | 1 | 0 | 1 | Legacy func_bomb_target touch. New one is more strict. <br/>`0` New behavior<br/>`1` Legacy behavior|
| mp_respawn_immunitytime | 0 | 0 | - | Specifies the players defense time after respawn. (in seconds).<br/>`0` disabled<br/>`>0.00001` time delay to remove protection | | mp_respawn_immunitytime | 0 | 0 | - | Specifies the players defense time after respawn. (in seconds).<br/>`0` disabled<br/>`>0.00001` time delay to remove protection |
| mp_kill_filled_spawn | 1 | 0 | 1 | Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).<br />Only disable this if you have semiclip or other plugins that prevents stucking.<br/>`0` disabled<br/>`1` enabled |
| mp_allow_point_servercommand | 0 | 0 | 1 | Allow use of point_servercommand entities in map.<br/>`0` disallow<br/>`1` allow<br/>`NOTE`: Potentially dangerous for untrusted maps.|
## How to install zBot for CS 1.6? ## How to install zBot for CS 1.6?
* Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true) * Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true)

8
dist/game.cfg vendored
View File

@ -201,3 +201,11 @@ mp_respawn_immunitytime "0"
// //
// Default value: "1" // Default value: "1"
mp_kill_filled_spawn "1" mp_kill_filled_spawn "1"
// Allow use of point_servercommand entities in map.
// NOTE: Potentially dangerous for untrusted maps.
// 0 - disallow
// 1 - allow
//
// Default value: "0"
mp_allow_point_servercommand "0"

View File

@ -71,6 +71,13 @@ LINK_ENTITY_TO_CLASS(point_servercommand, CPointServerCommand, CCSPointServerCom
void CPointServerCommand::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CPointServerCommand::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
#ifdef REGAMEDLL_ADD
if (!allow_point_servercommand.value) {
ALERT(at_warning, "point_servercommand usage blocked by mp_allow_point_servercommand setting\n");
return;
}
#endif
for (size_t cmd = 0; cmd < m_uiCommandsCount; cmd++) { for (size_t cmd = 0; cmd < m_uiCommandsCount; cmd++) {
Execute(m_iszCommands[cmd]); Execute(m_iszCommands[cmd]);
} }

View File

@ -119,6 +119,8 @@ cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", FCVAR_SERV
cvar_t respawn_immunitytime = { "mp_respawn_immunitytime", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t respawn_immunitytime = { "mp_respawn_immunitytime", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t kill_filled_spawn = { "mp_kill_filled_spawn", "1", FCVAR_SERVER, 0.0f, nullptr }; cvar_t kill_filled_spawn = { "mp_kill_filled_spawn", "1", FCVAR_SERVER, 0.0f, nullptr };
cvar_t allow_point_servercommand = { "mp_allow_point_servercommand", "0", 0, 0.0f, nullptr };
void GameDLL_Version_f() void GameDLL_Version_f()
{ {
if (Q_stricmp(CMD_ARGV(1), "version") != 0) if (Q_stricmp(CMD_ARGV(1), "version") != 0)
@ -288,6 +290,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&legacy_bombtarget_touch); CVAR_REGISTER(&legacy_bombtarget_touch);
CVAR_REGISTER(&respawn_immunitytime); CVAR_REGISTER(&respawn_immunitytime);
CVAR_REGISTER(&kill_filled_spawn); CVAR_REGISTER(&kill_filled_spawn);
CVAR_REGISTER(&allow_point_servercommand);
// print version // print version
CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n");

View File

@ -155,6 +155,7 @@ extern cvar_t item_staytime;
extern cvar_t legacy_bombtarget_touch; extern cvar_t legacy_bombtarget_touch;
extern cvar_t respawn_immunitytime; extern cvar_t respawn_immunitytime;
extern cvar_t kill_filled_spawn; extern cvar_t kill_filled_spawn;
extern cvar_t allow_point_servercommand;
#endif #endif