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
defaultproperties
{
{
configName = "AcediaGameModes"
configName = "AcediaGameModes"
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.")
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.beginnerSynonyms.length; i += 1)
for (i = 0; i < default.shortSynonyms.length; i += 1)
{
{
if (IsPrefixOf(difficulty, default.beginnerSynonyms[i])) {
if (IsPrefixOf(length, default.shortSynonyms[i])) {
return 1;
return 0;
}
}
}
}
for (i = 0; i < default.normalSynonyms.length; i += 1)
for (i = 0; i < default.normalSynonyms.length; i += 1)
{
{
if (IsPrefixOf(difficulty, default.normalSynonyms[i])) {
if (IsPrefixOf(length, default.normalSynonyms[i])) {
return 2;
return 1;
}
}
for (i = 0; i < default.hardSynonyms.length; i += 1)
{
if (IsPrefixOf(difficulty, default.hardSynonyms[i])) {
return 4;
}
}
}
}
for (i = 0; i < default.suicidalSynonyms.length; i += 1)
for (i = 0; i < default.longSynonyms.length; i += 1)
{
{
if (IsPrefixOf(difficulty, default.suicidalSynonyms[i])) {
if (IsPrefixOf(length, default.longSynonyms[i])) {
return 5;
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])) {
if (IsPrefixOf(length, default.customSynonyms[i])) {
return 7;
return 3;
}
}
}
}
return int(difficulty);
return 3;
}
}
protected final static function bool IsPrefixOf(string prefix, string value)
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
defaultproperties
{
{
beginnerSynonyms(0) = "easy"
shortSynonyms(0) = "short"
beginnerSynonyms(1) = "beginer"
normalSynonyms(0) = "normal"
beginnerSynonyms(2) = "beginner"
normalSynonyms(1) = "medium"
beginnerSynonyms(3) = "begginer"
normalSynonyms(2) = "regular"
beginnerSynonyms(4) = "begginner"
longSynonyms(0) = "long"
normalSynonyms(0) = "regular"
customSynonyms(0) = "custom"
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"
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`).")
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.")
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.")
fatBadGameConfigIndexAdapter = (l=LOG_Fatal,m="`XVotingHandler`'s `currentGameConfig` variable value of %1 is out-of-bounds for `VHAdapter` of length %2. Report this issue.")