Previously game dissivulty was switching through a crutch, when we
could've just used key-value option inside the server URL. That crutch
was repurposed to switch game length that is actually requires it.
for (i = 0; i < default.beginnerSynonyms.length; i += 1)
{
if (IsPrefixOf(lowerCaseDifficulty, default.beginnerSynonyms[i])) {
return 1;
}
}
for (i = 0; i < default.normalSynonyms.length; i += 1)
{
if (IsPrefixOf(lowerCaseDifficulty, default.normalSynonyms[i])) {
return 2;
}
}
for (i = 0; i < default.hardSynonyms.length; i += 1)
{
if (IsPrefixOf(lowerCaseDifficulty, default.hardSynonyms[i])) {
return 4;
}
}
for (i = 0; i < default.suicidalSynonyms.length; i += 1)
{
if (IsPrefixOf(lowerCaseDifficulty, default.suicidalSynonyms[i])) {
return 5;
}
}
for (i = 0; i < default.hoeSynonyms.length; i += 1)
{
if (IsPrefixOf(lowerCaseDifficulty, default.hoeSynonyms[i])) {
return 7;
}
}
return int(lowerCaseDifficulty);
}
protected final static function bool IsPrefixOf(string prefix, string value)
{
return (InStr(value, prefix) == 0);
}
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.")
beginnerSynonyms(0) = "easy"
beginnerSynonyms(1) = "beginer"
beginnerSynonyms(2) = "beginner"
beginnerSynonyms(3) = "begginer"
beginnerSynonyms(4) = "begginner"
normalSynonyms(0) = "regular"
normalSynonyms(1) = "default"
normalSynonyms(2) = "normal"
hardSynonyms(0) = "harder" // "hard" is prefix of this, so it will count
hardSynonyms(1) = "difficult"
suicidalSynonyms(0) = "suicidal"
hoeSynonyms(0) = "hellonearth"
hoeSynonyms(1) = "hellon earth"
hoeSynonyms(2) = "hell onearth"
hoeSynonyms(3) = "hoe"
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.")
warnDifficultyOption = (l=LOG_Warning,m="Option with key \"Difficulty\" is specified. This key reserved and will be ignored. Difficulty value should be set through the game mode's \"Difficulty\" setting in \"AcediaGameModes.ini\" config. This is a configuration error, you should fix it.")
for (i = 0; i < default.shortSynonyms.length; i += 1)
{
if (IsPrefixOf(difficulty, default.beginnerSynonyms[i])) {
return 1;
if (IsPrefixOf(length, default.shortSynonyms[i])) {
return 0;
}
}
for (i = 0; i < default.normalSynonyms.length; i += 1)
{
if (IsPrefixOf(difficulty, default.normalSynonyms[i])) {
return 2;
}
}
for (i = 0; i < default.hardSynonyms.length; i += 1)
{
if (IsPrefixOf(difficulty, default.hardSynonyms[i])) {
return 4;
if (IsPrefixOf(length, default.normalSynonyms[i])) {
return 1;
}
}
for (i = 0; i < default.suicidalSynonyms.length; i += 1)
for (i = 0; i < default.longSynonyms.length; i += 1)
{
if (IsPrefixOf(difficulty, default.suicidalSynonyms[i])) {
return 5;
if (IsPrefixOf(length, default.longSynonyms[i])) {
return 2;
}
}
for (i = 0; i < default.hoeSynonyms.length; i += 1)
for (i = 0; i < default.customSynonyms.length; i += 1)
{
if (IsPrefixOf(difficulty, default.hoeSynonyms[i])) {
return 7;
if (IsPrefixOf(length, default.customSynonyms[i])) {
return 3;
}
}
return int(difficulty);
return 3;
}
protected final static function bool IsPrefixOf(string prefix, string value)
@ -335,21 +341,12 @@ protected final static function bool IsPrefixOf(string prefix, string value)
defaultproperties
{
beginnerSynonyms(0) = "easy"
beginnerSynonyms(1) = "beginer"
beginnerSynonyms(2) = "beginner"
beginnerSynonyms(3) = "begginer"
beginnerSynonyms(4) = "begginner"
normalSynonyms(0) = "regular"
normalSynonyms(1) = "default"
normalSynonyms(2) = "normal"
hardSynonyms(0) = "harder" // "hard" is prefix of this, so it will count
hardSynonyms(1) = "difficult"
suicidalSynonyms(0) = "suicidal"
hoeSynonyms(0) = "hellonearth"
hoeSynonyms(1) = "hellon earth"
hoeSynonyms(2) = "hell onearth"
hoeSynonyms(3) = "hoe"
shortSynonyms(0) = "short"
normalSynonyms(0) = "normal"
normalSynonyms(1) = "medium"
normalSynonyms(2) = "regular"
longSynonyms(0) = "long"
customSynonyms(0) = "custom"
fatNoXVotingHandler = (l=LOG_Fatal,m="`XVotingHandler` class is missing. Make sure your server setup supports Acedia's game modes (by used voting handler derived from `XVotingHandler`).")
fatBadGameConfigIndexVH = (l=LOG_Fatal,m="`XVotingHandler`'s `currentGameConfig` variable value of %1 is out-of-bounds for `XVotingHandler.gameConfig` of length %2. Report this issue.")
fatBadGameConfigIndexAdapter = (l=LOG_Fatal,m="`XVotingHandler`'s `currentGameConfig` variable value of %1 is out-of-bounds for `VHAdapter` of length %2. Report this issue.")