Streamline UCS

This commit is contained in:
Akkadius
2019-09-02 01:39:52 -05:00
parent bfd0752c4d
commit ccbbadc5ee
10 changed files with 124 additions and 124 deletions
+12 -12
View File
@@ -73,10 +73,10 @@ int main() {
Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect
Log(Logs::General, Logs::UCSServer, "Starting EQEmu Universal Chat Server.");
LogInfo("Starting EQEmu Universal Chat Server");
if (!ucsconfig::LoadConfig()) {
Log(Logs::General, Logs::UCSServer, "Loading server configuration failed.");
LogInfo("Loading server configuration failed");
return 1;
}
@@ -84,7 +84,7 @@ int main() {
WorldShortName = Config->ShortName;
Log(Logs::General, Logs::UCSServer, "Connecting to MySQL...");
LogInfo("Connecting to MySQL");
if (!database.Connect(
Config->DatabaseHost.c_str(),
@@ -92,7 +92,7 @@ int main() {
Config->DatabasePassword.c_str(),
Config->DatabaseDB.c_str(),
Config->DatabasePort)) {
Log(Logs::General, Logs::UCSServer, "Cannot continue without a database connection.");
LogInfo("Cannot continue without a database connection");
return 1;
}
@@ -104,26 +104,26 @@ int main() {
// ucs has no 'reload rules' handler
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
Log(Logs::General, Logs::UCSServer, "Loading rule set '%s'", tmp);
LogInfo("Loading rule set [{}]", tmp);
if(!RuleManager::Instance()->LoadRules(&database, tmp, false)) {
Log(Logs::General, Logs::UCSServer, "Failed to load ruleset '%s', falling back to defaults.", tmp);
LogInfo("Failed to load ruleset [{}], falling back to defaults", tmp);
}
} else {
if(!RuleManager::Instance()->LoadRules(&database, "default", false)) {
Log(Logs::General, Logs::UCSServer, "No rule set configured, using default rules");
LogInfo("No rule set configured, using default rules");
} else {
Log(Logs::General, Logs::UCSServer, "Loaded default rule set 'default'", tmp);
LogInfo("Loaded default rule set 'default'", tmp);
}
}
EQEmu::InitializeDynamicLookups();
Log(Logs::General, Logs::UCSServer, "Initialized dynamic dictionary entries");
LogInfo("Initialized dynamic dictionary entries");
database.ExpireMail();
if(Config->ChatPort != Config->MailPort)
{
Log(Logs::General, Logs::UCSServer, "MailPort and CharPort must be the same in eqemu_config.xml for UCS.");
LogInfo("MailPort and CharPort must be the same in eqemu_config.json for UCS");
exit(1);
}
@@ -134,11 +134,11 @@ int main() {
database.LoadChatChannels();
if (signal(SIGINT, CatchSignal) == SIG_ERR) {
Log(Logs::General, Logs::UCSServer, "Could not set signal handler");
LogInfo("Could not set signal handler");
return 1;
}
if (signal(SIGTERM, CatchSignal) == SIG_ERR) {
Log(Logs::General, Logs::UCSServer, "Could not set signal handler");
LogInfo("Could not set signal handler");
return 1;
}