* Checks option-related settings (`option`) for correctness and reports
* any issues.
* Currently correctness check performs a simple validity check for mutator,
* to make sure it would not define a new option in server's URL.
*
* See `ValidateServerURLName()` in `BaseGameMode` for more information.
*/
public function ReportBadOptions()
{
local int i;
for (i = 0; i < option.length; i += 1)
{
if ( !ValidateServerURLName(option[i].key)
|| !ValidateServerURLName(option[i].value))
{
_.logger.Auto(warnBadOption)
.Arg(_.text.FromString(option[i].key))
.Arg(_.text.FromString(option[i].value))
.Arg(_.text.FromString(string(name)));
}
}
}
/**
* @return Server options as key-value pairs in an `AssociativeArray`.
*/
public function AssociativeArray GetOptions()
{
local int i;
local AssociativeArray result;
result = _.collections.EmptyAssociativeArray();
for (i = 0; i < option.length; i += 1)
{
if (!ValidateServerURLName(option[i].key)) continue;
if (!ValidateServerURLName(option[i].value)) continue;
result.SetItem( _.text.FromString(option[i].key),
_.text.FromString(option[i].value));
}
return result;
}
defaultproperties
{
configName = "AcediaGameModes"
warnBadOption = (l=LOG_Warning,m="Option with key \"%1\" and value \"%2\" specified for game mode \"%3\" contains invalid characters and will be ignored. This is a configuration error, you should fix it.")