Add more configs for ots-info site [skip ci]

This commit is contained in:
slawkens
2026-04-19 16:29:20 +02:00
parent a6a3c76b8d
commit 5dd97ad8fd

View File

@@ -15,7 +15,7 @@ class Config
$files = glob($path . '*.toml');
// filter files we don't need
$ignore = ['account_manager', 'gameplay', 'groups', 'mounts', 'object_pools', 'outfits', 'scripts'];
$ignore = ['account_manager', 'groups', 'mounts', 'object_pools', 'outfits', 'scripts'];
$files = array_filter($files, function ($file) use ($ignore) {
foreach ($ignore as $item) {
if (str_contains($file, $item)) {
@@ -41,10 +41,24 @@ class Config
}
}
$this->init();
}
private function init(): void
{
$this->config['serverName'] = $this->config['server']['identity']['name'] ?? 'Unknown';
$this->config['freePremium'] = $this->config['server']['accounts']['free_premium'] ?? false;
$this->config['ip'] = $this->config['server']['network']['ip'] ?? '127.0.0.1';
$this->config['worldType'] = $this->config['server']['world']['type'] ?? 'unknown';
$this->config['houseRentPeriod'] = $this->config['server']['houses']['rent_period'] ?? 'never';
$this->config['pzLocked'] = $this->config['combat']['skull']['pz_locked'] ?? 60 * 1000;
$this->config['url'] = $this->config['server']['identity']['url'] ?? 'http://localhost';
$this->config['protectionLevel'] = $this->config['server']['pvp']['protection_level'] ?? 0;
$this->config['rateExp'] = $this->config['rates']['rates']['experience'] ?? 1;
$this->config['rateMagic'] = $this->config['rates']['rates']['magic'] ?? 1;
$this->config['rateSkill'] = $this->config['rates']['rates']['skill'] ?? 1;
$this->config['rateLoot'] = $this->config['rates']['rates']['loot'] ?? 1;
$this->config['rateSpawn'] = $this->config['rates']['rates']['spawn'] ?? 1;
}
public function get(): array {