This commit is contained in:
WolverinDEV
2019-08-16 16:13:52 +02:00
parent bae6a56ed3
commit aa3de59652
14 changed files with 454 additions and 279 deletions
+6 -5
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();
}