mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Misc/Optimizations
* general minor cleanups * do not sync characters that haven't logged in since last resync.
This commit is contained in:
@@ -10,7 +10,7 @@ abstract class BaseType
|
||||
public $error = true;
|
||||
|
||||
protected $templates = [];
|
||||
protected $curTpl = []; // lets iterate!
|
||||
protected $curTpl = [];
|
||||
protected $matches = 0; // total matches unaffected by sqlLimit in config
|
||||
|
||||
protected $dbNames = ['Aowow']; // multiple DBs in profiler
|
||||
@@ -59,7 +59,6 @@ abstract class BaseType
|
||||
$where = [];
|
||||
$linking = ' AND ';
|
||||
$limit = CFG_SQL_LIMIT_DEFAULT;
|
||||
$className = get_class($this);
|
||||
|
||||
if (!$this->queryBase || $conditions === null)
|
||||
return;
|
||||
@@ -270,7 +269,7 @@ abstract class BaseType
|
||||
foreach ($rows as $id => $row)
|
||||
{
|
||||
if (isset($this->templates[$id]))
|
||||
trigger_error('guid for List already in use #'.$id, E_USER_WARNING);
|
||||
trigger_error('GUID for List already in use #'.$id.'. Additional occurrence omitted!', E_USER_ERROR);
|
||||
else
|
||||
$this->templates[$id] = $row;
|
||||
}
|
||||
@@ -573,7 +572,7 @@ trait spawnHelper
|
||||
}
|
||||
}
|
||||
|
||||
private function createFullSpawns() // for display on map (objsct/npc detail page)
|
||||
private function createFullSpawns() // for display on map (object/npc detail page)
|
||||
{
|
||||
$data = [];
|
||||
$wpSum = [];
|
||||
|
||||
@@ -285,11 +285,20 @@ class Profiler
|
||||
return false;
|
||||
|
||||
// reminder: this query should not fail: a placeholder entry is created as soon as a char listview is created or profile detail page is called
|
||||
$profileId = DB::Aowow()->selectCell('SELECT id FROM ?_profiler_profiles WHERE realm = ?d AND realmGUID = ?d', $realmId, $char['guid']);
|
||||
if (!$profileId)
|
||||
$profile = DB::Aowow()->selectRow('SELECT id, lastupdated FROM ?_profiler_profiles WHERE realm = ?d AND realmGUID = ?d', $realmId, $char['guid']);
|
||||
if (!$profile)
|
||||
return false; // well ... it failed
|
||||
|
||||
CLI::write('fetching char #'.$charGuid.' from realm #'.$realmId);
|
||||
$profileId = $profile['id'];
|
||||
|
||||
CLI::write('fetching char '.$char['name'].' (#'.$charGuid.') from realm #'.$realmId);
|
||||
|
||||
if (!$char['online'] && $char['logout_time'] <= $profile['lastupdated'])
|
||||
{
|
||||
CLI::write('char did not log in since last update. skipping...');
|
||||
return true;
|
||||
}
|
||||
|
||||
CLI::write('writing...');
|
||||
|
||||
$ra = (1 << ($char['race'] - 1));
|
||||
|
||||
@@ -648,7 +648,6 @@ $lang = array(
|
||||
SAI_ACTION_LOAD_EQUIPMENT => ['(%2$d)?Lege nicht-standart Ausrüstung ab:Rüste %7$s; von Ausrüstungs-Template #[b]%1$d[/b] an #target#(%8$d)?: aus;.', 'Hinweis: Gegenstände für Kreaturen haben nicht zwingend ein Gegenstands-Template'],
|
||||
SAI_ACTION_TRIGGER_RANDOM_TIMED_EVENT => ['Löse definiertes verzögertes Ereignis innerhalb von %7$s aus.', null],
|
||||
SAI_ACTION_REMOVE_ALL_GAMEOBJECTS => ['Entferne alle Gameobjects von #target#.', null],
|
||||
SAI_ACTION_STOP_MOTION => ['(%1$d)?Entferne motion type #[b]%1$d[/b] von #target#. :;(%2$d)?Beende Bewegung.:;', null],
|
||||
SAI_ACTION_PAUSE_MOVEMENT => ['Pausiere Bewegung aus Slot #[b]%1$d[/b] für %7$s.', 'Erzwungen'],
|
||||
null, // SAI_ACTION_PLAY_ANIMKIT = 128, // don't use on 3.3.5a
|
||||
null, // SAI_ACTION_SCENE_PLAY = 129, // don't use on 3.3.5a
|
||||
|
||||
@@ -111,7 +111,7 @@ class ObjectPage extends GenericPage
|
||||
|
||||
// if no propper item is found use a skill
|
||||
if ($locks)
|
||||
$infobox[] = $l ? $l : array_pop($locks);
|
||||
$infobox[] = $l ?: array_pop($locks);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user