fixed the default setup

This commit is contained in:
WolverinDEV 2019-09-09 14:02:47 +02:00
parent 05c3cab612
commit c8a6449a45

View File

@ -23,7 +23,7 @@ struct GroupInfo {
* 2 = Channel
*/
int target;
string propertyName;
std::deque<string> properties;
string name;
/* permission type, value, granted, skip, negate */
deque<tuple<permission::PermissionType, permission::PermissionValue, permission::PermissionValue, bool, bool>> permissions;
@ -62,7 +62,7 @@ bool InstanceHandler::setupDefaultGroups() {
continue;
}
if(line.find("property:") == 0) {
group->propertyName = line.substr(9);
group->properties.push_back(line.substr(9));
continue;
}
@ -132,10 +132,11 @@ bool InstanceHandler::setupDefaultGroups() {
for(auto perm : info->permissions) {
group->permissions()->set_permission(get<0>(perm), {get<1>(perm), get<2>(perm)}, permission::v2::set_value, permission::v2::set_value, get<3>(perm), get<4>(perm));
}
if(!info->propertyName.empty()) {
const auto& prop = property::impl::info<property::InstanceProperties>(info->propertyName);
for(const auto& property : info->properties) {
const auto& prop = property::impl::info<property::InstanceProperties>(property);
if(*prop == property::SERVERINSTANCE_UNDEFINED) {
logCritical(LOG_INSTANCE, "Invalid template property name: " + info->propertyName);
logCritical(LOG_INSTANCE, "Invalid template property name: " + property);
} else {
this->properties()[prop] = group->groupId();
}