Misc/Optimizations

* general minor cleanups
 * do not sync characters that haven't logged in since last resync.
This commit is contained in:
Sarjuuk
2020-12-17 22:07:44 +01:00
parent 82d3a8508d
commit be77474637
4 changed files with 16 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ abstract class BaseType
public $error = true; public $error = true;
protected $templates = []; protected $templates = [];
protected $curTpl = []; // lets iterate! protected $curTpl = [];
protected $matches = 0; // total matches unaffected by sqlLimit in config protected $matches = 0; // total matches unaffected by sqlLimit in config
protected $dbNames = ['Aowow']; // multiple DBs in profiler protected $dbNames = ['Aowow']; // multiple DBs in profiler
@@ -59,7 +59,6 @@ abstract class BaseType
$where = []; $where = [];
$linking = ' AND '; $linking = ' AND ';
$limit = CFG_SQL_LIMIT_DEFAULT; $limit = CFG_SQL_LIMIT_DEFAULT;
$className = get_class($this);
if (!$this->queryBase || $conditions === null) if (!$this->queryBase || $conditions === null)
return; return;
@@ -270,7 +269,7 @@ abstract class BaseType
foreach ($rows as $id => $row) foreach ($rows as $id => $row)
{ {
if (isset($this->templates[$id])) 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 else
$this->templates[$id] = $row; $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 = []; $data = [];
$wpSum = []; $wpSum = [];

View File

@@ -285,11 +285,20 @@ class Profiler
return false; 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 // 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']); $profile = DB::Aowow()->selectRow('SELECT id, lastupdated FROM ?_profiler_profiles WHERE realm = ?d AND realmGUID = ?d', $realmId, $char['guid']);
if (!$profileId) if (!$profile)
return false; // well ... it failed 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...'); CLI::write('writing...');
$ra = (1 << ($char['race'] - 1)); $ra = (1 << ($char['race'] - 1));

View File

@@ -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_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_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_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'], 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_PLAY_ANIMKIT = 128, // don't use on 3.3.5a
null, // SAI_ACTION_SCENE_PLAY = 129, // don't use on 3.3.5a null, // SAI_ACTION_SCENE_PLAY = 129, // don't use on 3.3.5a

View File

@@ -111,7 +111,7 @@ class ObjectPage extends GenericPage
// if no propper item is found use a skill // if no propper item is found use a skill
if ($locks) if ($locks)
$infobox[] = $l ? $l : array_pop($locks); $infobox[] = $l ?: array_pop($locks);
} }
} }