mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
fixed some issues:
- allowed colons in config strings - setup for tpl-files that only have const text
This commit is contained in:
@@ -81,7 +81,7 @@ foreach ($sets as $k => $v)
|
||||
else if ($v['flags'] & CON_FLAG_TYPE_BOOL)
|
||||
$val = (bool)$v['value'];
|
||||
else if ($v['flags'] & CON_FLAG_TYPE_STRING)
|
||||
$val = preg_replace('/[^\p{L}0-9~\s_\-\'\/\.,]/ui', '', $v['value']);
|
||||
$val = preg_replace('/[^\p{L}0-9~\s_\-\'\/\.:,]/ui', '', $v['value']);
|
||||
else
|
||||
{
|
||||
Util::addNote(U_GROUP_ADMIN | U_GROUP_DEV, 'Kernel: '.($php ? 'PHP' : 'Aowow').' config value '.($php ? strtolower($k) : 'CFG_'.strtoupper($k)).' has no type set. Value forced to 0!');
|
||||
|
||||
@@ -42,12 +42,7 @@ function build()
|
||||
|
||||
if (file_exists('setup/tools/filegen/'.$name.'.func.php'))
|
||||
require_once 'setup/tools/filegen/'.$name.'.func.php';
|
||||
else
|
||||
{
|
||||
CLISetup::log(sprintf(ERR_MISSING_INCL, $name, 'setup/tools/filegen/'.$name.'.func.php'), CLISetup::LOG_ERROR);
|
||||
$allOk = false;
|
||||
continue;
|
||||
}
|
||||
// else not necessarily an error, may only need replacement of const text
|
||||
|
||||
if (!CLISetup::writeDir($destPath))
|
||||
continue;
|
||||
@@ -74,14 +69,19 @@ function build()
|
||||
if (function_exists($func))
|
||||
$content = str_replace('/*setup:'.$func.'*/', $func(), $content);
|
||||
else
|
||||
CLISetup::log('Placeholder in template file does not match any known function name.', CLISetup::LOG_ERROR);
|
||||
{
|
||||
$allOk = false;
|
||||
CLISetup::log('No function for was registered for placeholder '.$func.'().', CLISetup::LOG_ERROR);
|
||||
if (!array_reduce(get_included_files(), function ($inArray, $itr) use ($func) { return $inArray || false !== strpos($itr, $func); }, false))
|
||||
CLISetup::log('Also, expected include setup/tools/filegen/'.$name.'.func.php was not found.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fWrite($dest, $content))
|
||||
{
|
||||
CLISetup::log(sprintf(ERR_NONE, CLISetup::bold($destPath.$file)), CLISetup::LOG_OK);
|
||||
if ($content)
|
||||
if ($content && $allOk)
|
||||
$ok = true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -59,12 +59,12 @@ if (!CLI)
|
||||
$data = $ratings;
|
||||
|
||||
$offsets = array_map(function ($v) { // LookupEntry(cr*GT_MAX_LEVEL+level-1)
|
||||
return abs($v) * 100 + 60 - 1;
|
||||
return $v * 100 + 60 - 1;
|
||||
}, $ratings);
|
||||
$base = DB::Aowow()->selectCol('SELECT CAST((idx + 1 - 60) / 100 AS UNSIGNED) AS ARRAY_KEY, ratio FROM dbc_gtcombatratings WHERE idx IN (?a)', $offsets);
|
||||
|
||||
$offsets = array_map(function ($v) { // LookupEntry((getClass()-1)*GT_MAX_RATING+cr+1)
|
||||
return (CLASS_WARRIOR - 1) * 32 + abs($v) + 1;
|
||||
return (CLASS_WARRIOR - 1) * 32 + $v + 1;
|
||||
}, $ratings);
|
||||
$mods = DB::Aowow()->selectCol('SELECT idx - 1 AS ARRAY_KEY, ratio FROM dbc_gtoctclasscombatratingscalar WHERE idx IN (?a)', $offsets);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user