mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Code] DatabaseUpdate Global to Singleton Cleanup (#4943)
Co-authored-by: Chris Miles <akkadius1@gmail.com>
This commit is contained in:
parent
b5f1e99d3b
commit
4f7ff2d6f2
@ -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;
|
||||
|
||||
@ -106,7 +106,6 @@ EQEmuLogSys LogSys;
|
||||
ZoneEventScheduler event_scheduler;
|
||||
WorldContentService content_service;
|
||||
PlayerEventLogs player_event_logs;
|
||||
DatabaseUpdate database_update;
|
||||
EvolvingItemsManager evolving_items_manager;
|
||||
|
||||
const SPDat_Spell_Struct* spells;
|
||||
@ -316,7 +315,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