diff options
author | Xanadu <none@none> | 2010-05-29 03:16:39 +0200 |
---|---|---|
committer | Xanadu <none@none> | 2010-05-29 03:16:39 +0200 |
commit | d104f19469f9a63636f16e0d0765cd6798bccf4b (patch) | |
tree | 200c4bb985b503d082a889722bafc3733776e831 /src/trinityrealm/Main.cpp | |
parent | de97bd4f00df0265d1c352611d40d82ffacf45d4 (diff) |
*Properly initialize members to prevent DB logging before the DB is started. Fixes a rarely seen startup crash.
*Code cleanup.
--HG--
branch : trunk
Diffstat (limited to 'src/trinityrealm/Main.cpp')
-rw-r--r-- | src/trinityrealm/Main.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/trinityrealm/Main.cpp b/src/trinityrealm/Main.cpp index f926aebf616..c642f57bd7e 100644 --- a/src/trinityrealm/Main.cpp +++ b/src/trinityrealm/Main.cpp @@ -199,21 +199,10 @@ extern int main(int argc, char **argv) return 1; ///- Initialize the log database - if (sConfig.GetBoolDefault("EnableLogDB", false)) - { - // everything successful - set var to enable DB logging once startup finished. - sLog.SetLogDBLater(true); - sLog.SetLogDB(false); - // ensure we've set realm to 0 (realmd realmid) - sLog.SetRealmID(0); - } - else - { - sLog.SetLogDBLater(false); - sLog.SetLogDB(false); - sLog.SetRealmID(0); - } - + sLog.SetLogDBLater(sConfig.GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. + sLog.SetLogDB(false); + sLog.SetRealmID(0); // ensure we've set realm to 0 (realmd realmid) + ///- Get the list of realms for the server sRealmList->Initialize(sConfig.GetIntDefault("RealmsStateUpdateDelay", 20)); if (sRealmList->size() == 0) @@ -306,10 +295,7 @@ extern int main(int argc, char **argv) sLog.SetLogDB(true); } else - { sLog.SetLogDB(false); - sLog.SetLogDBLater(false); - } ///- Wait for termination signal while (!stopEvent) |