A lot of updates

This commit is contained in:
WolverinDEV
2020-02-22 14:14:44 +01:00
parent 41d3d30386
commit 86942e45c9
7 changed files with 43 additions and 17 deletions
+8
View File
@@ -161,6 +161,14 @@ InstanceHandler::InstanceHandler(SqlDataManager *sql) : sql(sql) {
this->properties()[property::SERVERINSTANCE_UNIQUE_ID] = ""; /* we def got a new instance */
}
if(this->default_tree->channel_count() == 4) {
auto default_channel = this->default_tree->findChannel("[cspacer04]Default Channel", nullptr);
if(default_channel) {
auto ch = this->default_tree->createChannel(0, default_channel->channelId(), "[cspacer05]Administrator Room");
ch->permissions()->set_permission(permission::i_channel_needed_view_power, {75, 0}, permission::v2::set_value, permission::v2::do_nothing, false, false);
this->save_channel_permissions();
}
}
if(!this->default_tree->getDefaultChannel()) this->default_tree->setDefaultChannel(this->default_tree->findChannel("[cspacer04]Default Channel", nullptr));
if(!this->default_tree->getDefaultChannel()) this->default_tree->setDefaultChannel(*this->default_tree->channels().begin());
assert(this->default_tree->getDefaultChannel());