User Guide ‐ Main interface ‐ Settings ‐ Autosettings - MarechJ/hll_rcon_tool GitHub Wiki
🧭 You are here : Wiki home / User Guide / Main interface / Settings / Autosettings
Menu
What it is and what it is for
Autosettings contains a set of parameters and commands that will be automatically applied when defined conditions are met.
You can control almost every feature of CRCON through autosettings.
Any auto_settings_capable
command on the api/get_api_documentation
endpoint can be used.
This lets you do awesome things like enabling or disabling something (such as the seeding automod) during defined hours.
[!WARNING]
If enabled in Services, autosettings will always have the precedence over whatever you've manually set in the different settings pages.
[!TIP]
Autosettings are stored as a unique text string that must obey the JSON syntax.
The CRCON interface won't let you save your autosettings if they contain any syntax error.If you want to manually edit them, we advise you use a JSON syntax verifier.
For example : https://jsonlint.com/.
Here is a blank autosettings set.
It doesn't do anything, as it contains no parameters or commands in defaults
and has no rules
to evaluate.
{
"always_apply_defaults": true,
"can_invoke_multiple_rules": true,
"defaults": {},
"rules": [],
"_available_commands": {},
"_available_conditions": {}
}
Now we'll see how to configure the different parts.
- always_apply_defaults
- can_invoke_multiple_rules
- defaults
- rules
_available_commands
and_available_conditions
may contain templates.
These aren't used by anything and can stay empty, or even deleted.
always_apply_defaults
true
:
Rules > Defaults
Defaults commands and parameters values will be applied BEFORE rules evaluation.
Any parameter defined within a rule will prevail over what have been set in Defaults.
false
:
Defaults > Rules
Defaults commands and parameters values will be applied AFTER rules evaluation.
Any parameter defined within a rule will be overwritten by what have been set in Defaults.
Have a look at the Flow chart below.
can_invoke_multiple_rules
Allows multiple rules to be applied when their conditions are met.
true
:
If different rules conditions are met, their different commands and parameters values will be applied.
If the same command or parameter is present in different rules whose conditions are met, the last occurrence will get over the previous.
false
:
Only commands and parameters values from the first rule whose conditions are met (if any) will be applied.
If a rule's conditions are met, the following rules won't be evaluated.
defaults
Here you can define the default settings that will be applied on your game server.
To define a command, you have to put its corresponding API command name and its mandatory arguments in the "defaults" branch.
You'll find the complete list of available endpoints here : http://(your VPS IP):8010/api/get_api_documentation
Remember you only can use the endpoints that are auto_settings_capable
ie : if you want to set a Max queue length of 6 :
{
"always_apply_defaults": true,
"can_invoke_multiple_rules": true,
"defaults": {
"set_queue_length": {
"value": 6
}
},
"rules": []
}
We usually find here the main General settings parameters values that should be applied at all time :
- Auto balance enabled
- Votekick
- Team Switch Cooldown
- Autobalance threshold
- Idle Autokick Time
- Max Ping Autokick
- Max queue length
- Vip Slots Num
- Vote kick threshold
- Auto Votekick
Here is an usual set of "defaults" commands :
{
"always_apply_defaults": true,
"can_invoke_multiple_rules": true,
"defaults": {
"set_autobalance_enabled": {
"value": true
},
"set_autobalance_threshold": {
"max_diff": 2
}
"set_max_ping_autokick": {
"max_ms": 300
},
"set_queue_length": {
"value": 6
},
"set_vip_slots_num": {
"value": 1
},
"set_profanities": {
"profanities": [
"f-word",
"n-word"
]
},
"set_map_shuffle_enabled": {
"enabled": false
},
},
"rules": []
}
rules
Now we've set the "defaults" parameters, it's time to unleash the real power of autosettings !
A "rule" is a set of "commands" that will be applied when defined "conditions" are met.
Conditions
Different conditions are available :
player_count
: the number of connected players, expressed from a "min" and a "max".
You can invert the condition using the "not" parameter."player_count": { "min": 0, "max": 39, "not": false }
online_mods
: the number of moderators logged in a CRCON session, expressed from a "min" and a "max".
You can invert the condition using the "not" parameter."online_mods": { "min": 0, "max": 5, "not": false }
ingame_mods
: the number of moderators connected on server, expressed from a "min" and a "max".
You can invert the condition using the "not" parameter."ingame_mods": { "min": 0, "max": 5, "not": false }
current_map
: a list of maps in which we'll search for the current one.
You can invert the condition using the "not" parameter."current_map": { "maps": [ "stmariedumont_warfare", "carentan_warfare" ], "not": false }
time_of_day
: a time period, expressed from a "min" and a "max" hour. You can invert the condition using the "not" parameter.
You'll find your timezone code here : https://utctime.info/timezone/"time_of_day": { "min": "00:00", "max": "24:00", "timezone": "UTC", "not": false }
not
parameter
Using the Each condition can be inverted with the special parameter "not": true
.
The main use of it is for the time_of_day
condition.
For example :
You want to set some parameters during night hours (10pm to 5am).
As you can't set a min
value higher than the max
value, you can't define such a condition :
(this one won't work)
"time_of_day": {
"min": "22:00",
"max": "5:00",
"timezone": "UTC"
}
So, here comes not
to the rescue :
We define the "other part" of the day (5am to 10pm), then invert it, making it "10pm to 5am" :
"time_of_day": {
"min": "5:00",
"max": "22:00",
"timezone": "UTC",
"not": true
}
Syntax
To define a ruleset, you have to put its corresponding commands and conditions in the "rules" branch.
ie :
You want to set your "Idle autokick" time to 0 when there is less than 40 players connected.
{
"always_apply_defaults": false,
"can_invoke_multiple_rules": true,
"defaults": {},
"rules": [
{ <-- open a ruleset
"commands": { <-- open a commands set
"set_idle_autokick_time": {
"minutes": 0
}
}, <-- close the commands set
"conditions": { <-- open a conditions set
"player_count": {
"max": 39,
"min": 0
}
} <-- close the conditions set
} <-- close the ruleset
],
}
(delete the red comments if you intend to use this as a template)
As you can define multiple rules, be careful about overlapping conditions.
If, for example, you set two rules, with these conditions :
- Rule 1 : "if
player_count
is 0 < x < 50, set the parameter value to x" ; - Rule 2 : "if
player_count
is 40 < x < 100, set the parameter value to y".
...Your two rules conditions will be met when player_count
is 41 <= x <= 49.
During that time, if you set can_invoke_multiple_rules
to true
, the second rule will prevail (value = y).
if you set can_invoke_multiple_rules
to false
, only the first rule will be applied (value = x).
Uses cases
Map rotation based on the number of players (seed)
As you're trying to seed your server up to 40 players :
- you do not want the "hard" maps to appear ;
- you do not want the idle players to be kicked ;
- you want to allow the players to change team every 5 min ;
- you want a broadcast message to remind the server is in seed time.
So you either can :
- (method 1) set 2 rulesets :
- one for 0-39 players ingame ;
- another one for 40-100 players ingame.
- (method 2) set defaults to the "seeded" conditions and one ruleset that will prevail the defaults if there is less than 40 players ingame.
Method 1
{
"always_apply_defaults": false,
"can_invoke_multiple_rules": false,
"defaults": {
"set_queue_length": {
"value": 6
},
"set_vip_slots_num": {
"value": 1
},
"set_max_ping_autokick": {
"max_ms": 600
},
"set_autobalance_enabled": {
"value": true
},
"set_map_shuffle_enabled": {
"enabled": false
},
"set_autobalance_threshold": {
"max_diff": 2
}
},
"rules": [
{
"commands": {
"set_maprotation": {
"map_names": [
"stmariedumont_warfare",
"stmereeglise_warfare",
"carentan_warfare"
]
},
"set_idle_autokick_time": {
"minutes": 0
},
"set_team_switch_cooldown": {
"minutes": 5
},
"set_broadcast": {
"message": "The server is seeding until 40 players are connected."
}
},
"conditions": {
"player_count": {
"max": 39,
"min": 0
}
}
},
{
"commands": {
"set_maprotation": {
"map_names": [
"elalamein_warfare",
"foy_warfare",
"kursk_warfare"
]
},
"set_idle_autokick_time": {
"minutes": 10
},
"set_team_switch_cooldown": {
"minutes": 10
}
},
"conditions": {
"player_count": {
"max": 100,
"min": 40
}
}
}
]
}
Method 2
{
"always_apply_defaults": false,
"can_invoke_multiple_rules": false,
"defaults": {
"set_queue_length": {
"value": 6
},
"set_vip_slots_num": {
"value": 1
},
"set_max_ping_autokick": {
"max_ms": 600
},
"set_autobalance_enabled": {
"value": true
},
"set_map_shuffle_enabled": {
"enabled": false
},
"set_autobalance_threshold": {
"max_diff": 2
},
"set_maprotation": {
"map_names": [
"elalamein_warfare",
"foy_warfare",
"kursk_warfare"
]
},
"set_idle_autokick_time": {
"minutes": 10
},
"set_team_switch_cooldown": {
"minutes": 10
}
},
"rules": [
{
"commands": {
"set_maprotation": {
"map_names": [
"stmariedumont_warfare",
"stmereeglise_warfare",
"carentan_warfare"
]
},
"set_idle_autokick_time": {
"minutes": 0
},
"set_team_switch_cooldown": {
"minutes": 5
},
"set_broadcast": {
"message": "The server is seeding until 40 players are connected."
}
},
"conditions": {
"player_count": {
"max": 39,
"min": 0
}
}
}
]
}
Map rotation based on time of day
You'd like to have a different map set during night hours
{
"always_apply_defaults": false,
"can_invoke_multiple_rules": false,
"defaults": {
"set_maprotation": {
"map_names": [
"elalamein_warfare",
"foy_warfare",
"kursk_warfare"
]
},
"set_broadcast": {
"message": "Day time map rotation"
}
},
"rules": [
{
"commands": {
"set_maprotation": {
"map_names": [
"stmariedumont_warfare",
"stmereeglise_warfare",
"carentan_warfare"
]
},
"set_broadcast": {
"message": "Night time map rotation"
}
},
"conditions": {
"time_of_day": {
"min": "5:00",
"max": "22:00",
"timezone": "UTC",
"not": true
}
}
}
]
}
Map rotation based on number of players + time of day
You'd like to have a different map set during night hours, and also according to the number of players.
So, that would give something like :
- "Easy" maps during night hours" ;
- "Easy + hard maps during day time" ;
- "Skirmish maps if there's less than 40 players, whatever the time".
{
"always_apply_defaults": false,
"can_invoke_multiple_rules": true,
"defaults": {
"set_maprotation": {
"map_names": [
"stmariedumont_warfare",
"stmereeglise_warfare",
"carentan_warfare",
"elalamein_warfare",
"foy_warfare",
"kursk_warfare"
]
}
},
"rules": [
{
"commands": {
"set_maprotation": {
"map_names": [
"stmariedumont_warfare",
"stmereeglise_warfare",
"carentan_warfare"
]
},
"set_broadcast": {
"message": "Night time map rotation"
}
},
"conditions": {
"time_of_day": {
"min": "5:00",
"max": "22:00",
"timezone": "UTC",
"not": true
}
}
},
{
"commands": {
"set_maprotation": {
"map_names": [
"mortain_skirmish_day",
"mortain_skirmish_overcast",
"SMDM_S_1944_Day_P_Skirmish",
"SMDM_S_1944_Night_P_Skirmish",
"SMDM_S_1944_Rain_P_Skirmish"
]
},
"set_broadcast": {
"message": "Less than 40 players ingame - Only skirmish maps"
}
},
"conditions": {
"player_count": {
"max": 39,
"min": 0
}
}
}
]
}
Votemap whitelist
[!NOTE]
Make sure the Votemap feature feature is enabled and configured.
Defining a whitelists in autosettings is similar as map rotation lists :
You have to set them in "commands" parts, like this :
"set_votemap_whitelist": {
"map_names": [
"carentan_warfare",
"stmariedumont_warfare",
"stmereeglise_warfare"
]
}
You can have different whitelists according to different rules conditions, exactly as map rotations.
Modifying user settings
For the user_config
endpoints and only those settings (for example set_auto_mod_seeding_config
), you can provide partial values, so only the provided values will change.
All other commands require you to pass every required parameter.
For example : you can pass just the enabled
parameter, so you don't have to duplicate all of your other settings :
"rules": [
{
"commands": {
"set_auto_mod_seeding_config": {
"enabled": true
}
},
"conditions": {
"player_count": {
"max": 30,
"min": 0
}
}
}
]