Core/Config

* convert configuration from list of constants to object
 * fixes config changes not applying on cli whithout closing and reopening again
 * config variables are no longer embedded in localization text
This commit is contained in:
Sarjuuk
2024-05-28 15:41:44 +02:00
parent 454e09cc78
commit f77d676a19
94 changed files with 1094 additions and 922 deletions

View File

@@ -177,7 +177,7 @@ class ZonePage extends GenericPage
$cSpawns = DB::Aowow()->select('SELECT * FROM ?_spawns WHERE areaId = ?d AND type = ?d', $this->typeId, Type::NPC);
$aSpawns = User::isInGroup(U_GROUP_STAFF) ? DB::Aowow()->select('SELECT * FROM ?_spawns WHERE areaId = ?d AND type = ?d', $this->typeId, Type::AREATRIGGER) : [];
$conditions = [CFG_SQL_LIMIT_NONE, ['s.areaId', $this->typeId]];
$conditions = [Cfg::get('SQL_LIMIT_NONE'), ['s.areaId', $this->typeId]];
if (!User::isInGroup(U_GROUP_STAFF))
$conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0];
@@ -522,7 +522,7 @@ class ZonePage extends GenericPage
'note' => sprintf(Util::$filterResultString, '?npcs&filter=cr=6;crs='.$this->typeId.';crv=0')
);
if ($creatureSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT)
if ($creatureSpawns->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
$tabData['_truncated'] = 1;
$this->extendGlobalData($creatureSpawns->getJSGlobals(GLOBALINFO_SELF));
@@ -538,7 +538,7 @@ class ZonePage extends GenericPage
'note' => sprintf(Util::$filterResultString, '?objects&filter=cr=1;crs='.$this->typeId.';crv=0')
);
if ($objectSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT)
if ($objectSpawns->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT'))
$tabData['_truncated'] = 1;
$this->extendGlobalData($objectSpawns->getJSGlobals(GLOBALINFO_SELF));