mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-06 00:32:25 +00:00
[Code] DatabaseUpdate Global to Singleton Cleanup
This commit is contained in:
parent
1be7e56b86
commit
511829351c
@ -33,6 +33,13 @@ public:
|
||||
DatabaseUpdate *SetContentDatabase(Database *db);
|
||||
DatabaseUpdate *SetSkipBackup(bool skip);
|
||||
bool HasPendingUpdates();
|
||||
|
||||
static DatabaseUpdate* Instance()
|
||||
{
|
||||
static DatabaseUpdate instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_skip_backup = false;
|
||||
Database *m_database;
|
||||
|
||||
@ -109,7 +109,6 @@ ZoneEventScheduler event_scheduler;
|
||||
WorldContentService content_service;
|
||||
PathManager path;
|
||||
PlayerEventLogs player_event_logs;
|
||||
DatabaseUpdate database_update;
|
||||
SkillCaps skill_caps;
|
||||
EvolvingItemsManager evolving_items_manager;
|
||||
|
||||
@ -320,7 +319,7 @@ int main(int argc, char **argv)
|
||||
|
||||
const auto c = EQEmuConfig::get();
|
||||
if (c->auto_database_updates) {
|
||||
if (database_update.SetDatabase(&database)->HasPendingUpdates()) {
|
||||
if (DatabaseUpdate::Instance()->SetDatabase(&database)->HasPendingUpdates()) {
|
||||
LogWarning("Database is not up to date [world] needs to be ran to apply updates, shutting down in 5 seconds");
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
|
||||
LogInfo("Exiting due to pending database updates");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user