Merge branch 'master' into multitool/public
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Dieser Commit ist enthalten in:
Commit
1755d5a99a
@ -26,7 +26,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public class SchematicType {
|
public class SchematicType {
|
||||||
|
|
||||||
public static final SchematicType Normal = new SchematicType("Normal", "", Type.NORMAL, null, "STONE_BUTTON");
|
public static final SchematicType Normal = new SchematicType("Normal", "", Type.NORMAL, null, "STONE_BUTTON", false);
|
||||||
|
|
||||||
private static final Map<String, SchematicType> fromDB;
|
private static final Map<String, SchematicType> fromDB;
|
||||||
private static final List<SchematicType> types;
|
private static final List<SchematicType> types;
|
||||||
@ -60,25 +60,31 @@ public class SchematicType {
|
|||||||
private final String material;
|
private final String material;
|
||||||
@Getter
|
@Getter
|
||||||
private final Date deadline;
|
private final Date deadline;
|
||||||
|
@Getter
|
||||||
|
private final boolean manualCheck;
|
||||||
|
|
||||||
SchematicType(String name, String kuerzel, Type type, SchematicType checkType, String material){
|
SchematicType(String name, String kuerzel, Type type, SchematicType checkType, String material, boolean manualCheck){
|
||||||
this(name, kuerzel, type, checkType, material, null);
|
this(name, kuerzel, type, checkType, material, null, manualCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
SchematicType(String name, String kuerzel, Type type, SchematicType checkType, String material, Date deadline){
|
SchematicType(String name, String kuerzel, Type type, SchematicType checkType, String material, Date deadline, boolean manualCheck){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.kuerzel = kuerzel;
|
this.kuerzel = kuerzel;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.checkType = checkType;
|
this.checkType = checkType;
|
||||||
this.material = material;
|
this.material = material;
|
||||||
this.deadline = deadline;
|
this.deadline = deadline;
|
||||||
|
this.manualCheck = manualCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAssignable(){
|
public boolean isAssignable(){
|
||||||
return type == Type.NORMAL || (type == Type.FIGHT_TYPE && checkType != null);
|
return type == Type.NORMAL || (type == Type.FIGHT_TYPE && checkType != null) || !manualCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchematicType checkType(){
|
public SchematicType checkType(){
|
||||||
|
if (!manualCheck) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
return checkType;
|
return checkType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ public class SteamwarUser {
|
|||||||
String l = rs.getString(identifier);
|
String l = rs.getString(identifier);
|
||||||
return l != null ? Locale.forLanguageTag(l) : null;
|
return l != null ? Locale.forLanguageTag(l) : null;
|
||||||
}, (st, index, value) -> st.setString(index, value.toLanguageTag()));
|
}, (st, index, value) -> st.setString(index, value.toLanguageTag()));
|
||||||
SqlTypeMapper.nameEnumMapper(UserGroup.class);
|
|
||||||
new SqlTypeMapper<>(SteamwarUser.class, null, (rs, identifier) -> { throw new SecurityException("SteamwarUser cannot be used as type (recursive select)"); }, (st, index, value) -> st.setInt(index, value.id));
|
new SqlTypeMapper<>(SteamwarUser.class, null, (rs, identifier) -> { throw new SecurityException("SteamwarUser cannot be used as type (recursive select)"); }, (st, index, value) -> st.setInt(index, value.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,10 +112,6 @@ public class SteamwarUser {
|
|||||||
@Getter
|
@Getter
|
||||||
@Field
|
@Field
|
||||||
private String userName;
|
private String userName;
|
||||||
@Deprecated
|
|
||||||
@Getter
|
|
||||||
@Field(def = "'Member'")
|
|
||||||
private final UserGroup userGroup;
|
|
||||||
@Getter
|
@Getter
|
||||||
@Field(def = "0")
|
@Field(def = "0")
|
||||||
private int team;
|
private int team;
|
||||||
@ -135,11 +130,10 @@ public class SteamwarUser {
|
|||||||
private Set<UserPerm> permissions = null;
|
private Set<UserPerm> permissions = null;
|
||||||
private UserPerm.Prefix prefix = null;
|
private UserPerm.Prefix prefix = null;
|
||||||
|
|
||||||
public SteamwarUser(int id, UUID uuid, String userName, UserGroup userGroup, int team, boolean leader, Locale locale, boolean manualLocale, Long discordId) {
|
public SteamwarUser(int id, UUID uuid, String userName, int team, boolean leader, Locale locale, boolean manualLocale, Long discordId) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.userGroup = userGroup;
|
|
||||||
this.team = team;
|
this.team = team;
|
||||||
this.leader = leader;
|
this.leader = leader;
|
||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of the SteamWar software.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 SteamWar.de-Serverteam
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.steamwar.sql;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum UserGroup {
|
|
||||||
Admin("§4", "§e", "Admin", true, true, true, true),
|
|
||||||
Developer("§3", "§f", "Dev", true, true, true, true),
|
|
||||||
Moderator("§c", "§f", "Mod", true, true, true, true),
|
|
||||||
Supporter("§9", "§f", "Sup", false, true, true, true),
|
|
||||||
Builder("§2", "§f", "Arch", false, true, false, true),
|
|
||||||
YouTuber("§5", "§f", "YT", false, false, false, true),
|
|
||||||
Member("§7", "§7", "", false, false, false, false);
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
private final String colorCode;
|
|
||||||
@Getter
|
|
||||||
private final String chatColorCode;
|
|
||||||
@Getter
|
|
||||||
private final String chatPrefix;
|
|
||||||
@Getter
|
|
||||||
private final boolean adminGroup;
|
|
||||||
@Getter
|
|
||||||
private final boolean teamGroup;
|
|
||||||
@Getter
|
|
||||||
private final boolean checkSchematics;
|
|
||||||
@Getter
|
|
||||||
private final boolean privilegedMods;
|
|
||||||
|
|
||||||
public static UserGroup getUsergroup(String name) {
|
|
||||||
for(UserGroup group : values()) {
|
|
||||||
if(group.name().equalsIgnoreCase(name))
|
|
||||||
return group;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new IllegalArgumentException(name);
|
|
||||||
}
|
|
||||||
}
|
|
@ -51,14 +51,14 @@ public enum UserPerm {
|
|||||||
Map<UserPerm, Prefix> p = new EnumMap<>(UserPerm.class);
|
Map<UserPerm, Prefix> p = new EnumMap<>(UserPerm.class);
|
||||||
emptyPrefix = new Prefix("§7", "");
|
emptyPrefix = new Prefix("§7", "");
|
||||||
p.put(PREFIX_NONE, emptyPrefix);
|
p.put(PREFIX_NONE, emptyPrefix);
|
||||||
p.put(PREFIX_YOUTUBER, new Prefix("§5", "YT"));
|
p.put(PREFIX_YOUTUBER, new Prefix("§7", "YT"));
|
||||||
p.put(PREFIX_GUIDE, new Prefix("§f", "Guide"));
|
p.put(PREFIX_GUIDE, new Prefix("§a", "Guide"));
|
||||||
|
|
||||||
p.put(PREFIX_BUILDER, new Prefix("§2", "Arch"));
|
p.put(PREFIX_SUPPORTER, new Prefix("§6", "Sup"));
|
||||||
p.put(PREFIX_SUPPORTER, new Prefix("§9", "Sup"));
|
|
||||||
p.put(PREFIX_MODERATOR, new Prefix("§6", "Mod"));
|
p.put(PREFIX_MODERATOR, new Prefix("§6", "Mod"));
|
||||||
p.put(PREFIX_DEVELOPER, new Prefix("§b", "Dev"));
|
p.put(PREFIX_BUILDER, new Prefix("§e", "Arch"));
|
||||||
p.put(PREFIX_ADMIN, new Prefix("§4", "Admin"));
|
p.put(PREFIX_DEVELOPER, new Prefix("§e", "Dev"));
|
||||||
|
p.put(PREFIX_ADMIN, new Prefix("§e", "Admin"));
|
||||||
prefixes = Collections.unmodifiableMap(p);
|
prefixes = Collections.unmodifiableMap(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren