mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/Creatures
* hide creatures for internal use from listviews * correct Nightelf Player faction * trying to enforce strict line endings
This commit is contained in:
@@ -1,95 +1,95 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
if (!CLI)
|
||||
die('not in cli mode');
|
||||
|
||||
|
||||
$customData = array(
|
||||
);
|
||||
$reqDBC = ['emotes', 'emotestext', 'emotestextdata' /*, 'emotestextsound' */];
|
||||
|
||||
function emotes(/*array $ids = [] */)
|
||||
{
|
||||
$globStrPath = CLISetup::$srcDir.'%sInterface/FrameXML/GlobalStrings.lua';
|
||||
$allOK = true;
|
||||
$locPath = [];
|
||||
|
||||
DB::Aowow()->query('TRUNCATE ?_emotes_aliasses');
|
||||
|
||||
foreach (CLISetup::$localeIds as $lId)
|
||||
{
|
||||
foreach (CLISetup::$expectedPaths as $xp => $locId)
|
||||
{
|
||||
if ($lId != $locId)
|
||||
continue;
|
||||
|
||||
if ($xp) // if in subDir add trailing slash
|
||||
$xp .= '/';
|
||||
|
||||
$path = sprintf($globStrPath, $xp);
|
||||
if (CLISetup::fileExists($path))
|
||||
{
|
||||
$locPath[$lId] = $path;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
CLISetup::log('GlobalStrings.lua not found for selected locale '.CLISetup::bold(Util::$localeStrings[$lId]), CLISetup::LOG_WARN);
|
||||
$allOK = false;
|
||||
}
|
||||
|
||||
$_= DB::Aowow()->query('REPLACE INTO ?_emotes SELECT
|
||||
et.Id,
|
||||
LOWER(et.command),
|
||||
IF(e.animationId, 1, 0),
|
||||
0, -- cuFlags
|
||||
etdT.text_loc0, etdT.text_loc2, etdT.text_loc3, etdT.text_loc6, etdT.text_loc8,
|
||||
etdNT.text_loc0, etdNT.text_loc2, etdNT.text_loc3, etdNT.text_loc6, etdNT.text_loc8,
|
||||
etdS.text_loc0, etdS.text_loc2, etdS.text_loc3, etdS.text_loc6, etdS.text_loc8
|
||||
FROM
|
||||
dbc_emotestext et
|
||||
LEFT JOIN
|
||||
dbc_emotes e ON e.Id = et.emoteId
|
||||
LEFT JOIN
|
||||
dbc_emotestextdata etdT ON etdT.Id = et.targetId
|
||||
LEFT JOIN
|
||||
dbc_emotestextdata etdNT ON etdNT.Id = et.noTargetId
|
||||
LEFT JOIN
|
||||
dbc_emotestextdata etdS ON etdS.Id = et.selfId'
|
||||
);
|
||||
|
||||
if (!$_)
|
||||
$allOK = false;
|
||||
|
||||
// i have no idea, how the indexing in this file works.
|
||||
// sometimes the \d+ after EMOTE is the emoteTextId, but not nearly often enough
|
||||
$aliasses = [];
|
||||
foreach ($locPath as $lId => $path)
|
||||
foreach (file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line)
|
||||
if (preg_match('/^EMOTE(\d+)_CMD\d+\s=\s\"\/([^"]+)\";$/', $line, $m))
|
||||
$aliasses[$m[1]][] = [$lId, $m[2]];
|
||||
|
||||
|
||||
$emotes = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, cmd FROM ?_emotes');
|
||||
|
||||
foreach($emotes as $eId => $cmd)
|
||||
{
|
||||
foreach ($aliasses as $gsId => $data)
|
||||
{
|
||||
if (in_array($cmd, array_column($data, 1)))
|
||||
{
|
||||
foreach ($data as $d)
|
||||
DB::Aowow()->query('INSERT IGNORE INTO ?_emotes_aliasses VALUES (?d, ?d, ?) ON DUPLICATE KEY UPDATE locales = locales | ?d', $eId, (1 << $d[0]), strtolower($d[1]), (1 << $d[0]));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $allOK;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
if (!CLI)
|
||||
die('not in cli mode');
|
||||
|
||||
|
||||
$customData = array(
|
||||
);
|
||||
$reqDBC = ['emotes', 'emotestext', 'emotestextdata' /*, 'emotestextsound' */];
|
||||
|
||||
function emotes(/*array $ids = [] */)
|
||||
{
|
||||
$globStrPath = CLISetup::$srcDir.'%sInterface/FrameXML/GlobalStrings.lua';
|
||||
$allOK = true;
|
||||
$locPath = [];
|
||||
|
||||
DB::Aowow()->query('TRUNCATE ?_emotes_aliasses');
|
||||
|
||||
foreach (CLISetup::$localeIds as $lId)
|
||||
{
|
||||
foreach (CLISetup::$expectedPaths as $xp => $locId)
|
||||
{
|
||||
if ($lId != $locId)
|
||||
continue;
|
||||
|
||||
if ($xp) // if in subDir add trailing slash
|
||||
$xp .= '/';
|
||||
|
||||
$path = sprintf($globStrPath, $xp);
|
||||
if (CLISetup::fileExists($path))
|
||||
{
|
||||
$locPath[$lId] = $path;
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
CLISetup::log('GlobalStrings.lua not found for selected locale '.CLISetup::bold(Util::$localeStrings[$lId]), CLISetup::LOG_WARN);
|
||||
$allOK = false;
|
||||
}
|
||||
|
||||
$_= DB::Aowow()->query('REPLACE INTO ?_emotes SELECT
|
||||
et.Id,
|
||||
LOWER(et.command),
|
||||
IF(e.animationId, 1, 0),
|
||||
0, -- cuFlags
|
||||
etdT.text_loc0, etdT.text_loc2, etdT.text_loc3, etdT.text_loc6, etdT.text_loc8,
|
||||
etdNT.text_loc0, etdNT.text_loc2, etdNT.text_loc3, etdNT.text_loc6, etdNT.text_loc8,
|
||||
etdS.text_loc0, etdS.text_loc2, etdS.text_loc3, etdS.text_loc6, etdS.text_loc8
|
||||
FROM
|
||||
dbc_emotestext et
|
||||
LEFT JOIN
|
||||
dbc_emotes e ON e.Id = et.emoteId
|
||||
LEFT JOIN
|
||||
dbc_emotestextdata etdT ON etdT.Id = et.targetId
|
||||
LEFT JOIN
|
||||
dbc_emotestextdata etdNT ON etdNT.Id = et.noTargetId
|
||||
LEFT JOIN
|
||||
dbc_emotestextdata etdS ON etdS.Id = et.selfId'
|
||||
);
|
||||
|
||||
if (!$_)
|
||||
$allOK = false;
|
||||
|
||||
// i have no idea, how the indexing in this file works.
|
||||
// sometimes the \d+ after EMOTE is the emoteTextId, but not nearly often enough
|
||||
$aliasses = [];
|
||||
foreach ($locPath as $lId => $path)
|
||||
foreach (file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line)
|
||||
if (preg_match('/^EMOTE(\d+)_CMD\d+\s=\s\"\/([^"]+)\";$/', $line, $m))
|
||||
$aliasses[$m[1]][] = [$lId, $m[2]];
|
||||
|
||||
|
||||
$emotes = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, cmd FROM ?_emotes');
|
||||
|
||||
foreach($emotes as $eId => $cmd)
|
||||
{
|
||||
foreach ($aliasses as $gsId => $data)
|
||||
{
|
||||
if (in_array($cmd, array_column($data, 1)))
|
||||
{
|
||||
foreach ($data as $d)
|
||||
DB::Aowow()->query('INSERT IGNORE INTO ?_emotes_aliasses VALUES (?d, ?d, ?) ON DUPLICATE KEY UPDATE locales = locales | ?d', $eId, (1 << $d[0]), strtolower($d[1]), (1 << $d[0]));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $allOK;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user