Adding by default a music bot to each newly created server
This commit is contained in:
@@ -308,7 +308,7 @@ size_t VirtualServerManager::usedSlots() {
|
||||
return res;
|
||||
}
|
||||
|
||||
shared_ptr<VirtualServer> VirtualServerManager::createServer(std::string hosts, uint16_t port) {
|
||||
shared_ptr<VirtualServer> VirtualServerManager::create_server(std::string hosts, uint16_t port) {
|
||||
bool sid_success = false;
|
||||
|
||||
ServerId serverId = this->next_available_server_id(sid_success);
|
||||
@@ -321,7 +321,7 @@ shared_ptr<VirtualServer> VirtualServerManager::createServer(std::string hosts,
|
||||
variable{":target_sid", serverId},
|
||||
variable{":type", property::PROP_TYPE_SERVER}).execute();
|
||||
if(!prop_copy.success)
|
||||
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());
|
||||
server->self = server;
|
||||
@@ -330,7 +330,10 @@ shared_ptr<VirtualServer> VirtualServerManager::createServer(std::string hosts,
|
||||
}
|
||||
server->properties()[property::VIRTUALSERVER_HOST] = hosts;
|
||||
server->properties()[property::VIRTUALSERVER_PORT] = port;
|
||||
|
||||
auto bot = server->musicManager->createBot(0);
|
||||
if(!bot) {
|
||||
logCritical(server->getServerId(), "Failed to create default music bot!");
|
||||
}
|
||||
{
|
||||
threads::MutexLock l(this->instanceLock);
|
||||
this->instances.push_back(server);
|
||||
|
||||
Reference in New Issue
Block a user