Fixed config error

This commit is contained in:
WolverinDEV 2020-02-20 13:12:14 +01:00
parent aa08bfbf1b
commit fd36ce87cf

View File

@ -320,8 +320,8 @@ shared_ptr<VirtualServer> VirtualServerManager::create_server(std::string hosts,
auto prop_copy = sql::command(this->handle->getSql(), "INSERT INTO `properties` (`serverId`, `type`, `id`, `key`, `value`) SELECT :target_sid AS `serverId`, `type`, `id`, `key`, `value` FROM `properties` WHERE `type` = :type AND `id` = 0 AND `serverId` = 0;", auto prop_copy = sql::command(this->handle->getSql(), "INSERT INTO `properties` (`serverId`, `type`, `id`, `key`, `value`) SELECT :target_sid AS `serverId`, `type`, `id`, `key`, `value` FROM `properties` WHERE `type` = :type AND `id` = 0 AND `serverId` = 0;",
variable{":target_sid", serverId}, variable{":target_sid", serverId},
variable{":type", property::PROP_TYPE_SERVER}).execute(); variable{":type", property::PROP_TYPE_SERVER}).execute();
if(!prop_copy.success) if(!prop_copy)
logCritical(LOG_GENERAL, "Failed to copy default server properties: {}", prop_copy.fmtStr()); logCritical(LOG_GENERAL, "Failed to copy default server properties: {}", prop_copy.fmtStr());
auto server = make_shared<VirtualServer>(serverId, this->handle->getSql()); auto server = make_shared<VirtualServer>(serverId, this->handle->getSql());
server->self = server; server->self = server;
@ -330,9 +330,11 @@ shared_ptr<VirtualServer> VirtualServerManager::create_server(std::string hosts,
} }
server->properties()[property::VIRTUALSERVER_HOST] = hosts; server->properties()[property::VIRTUALSERVER_HOST] = hosts;
server->properties()[property::VIRTUALSERVER_PORT] = port; server->properties()[property::VIRTUALSERVER_PORT] = port;
auto bot = server->musicManager->createBot(0); if(!config::server::default_music_bot) {
if(!bot) { auto bot = server->musicManager->createBot(0);
logCritical(server->getServerId(), "Failed to create default music bot!"); if(!bot) {
logCritical(server->getServerId(), "Failed to create default music bot!");
}
} }
{ {
threads::MutexLock l(this->instanceLock); threads::MutexLock l(this->instanceLock);