From fc71f47add37ac29e5bcc5820a2634f6cb24040d Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 9 Nov 2025 17:25:19 +0100 Subject: [PATCH] Remove `needsAdmin` property from `PunishmentType` enum and refactor related declarations for cleaner structure. Signed-off-by: Chaoscaot --- CommonCore/SQL/src/de/steamwar/sql/Punishment.kt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/CommonCore/SQL/src/de/steamwar/sql/Punishment.kt b/CommonCore/SQL/src/de/steamwar/sql/Punishment.kt index 0ba89672..9c866325 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/Punishment.kt +++ b/CommonCore/SQL/src/de/steamwar/sql/Punishment.kt @@ -125,7 +125,6 @@ class Punishment(id: EntityID) : IntEntity(id) { fun isCurrent() = perma || endTime.after(Date()) enum class PunishmentType( - val needsAdmin: Boolean, val teamMessage: String?, val playerMessagePerma: String?, val playerMessageUntil: String?, @@ -134,10 +133,9 @@ class Punishment(id: EntityID) : IntEntity(id) { val userPerm: UserPerm, val multi: Boolean = false ) { - Ban(false, "BAN_TEAM", "BAN_PERMA", "BAN_UNTIL", "UNBAN_ERROR", "UNBAN", UserPerm.TEAM), - Mute(false, "MUTE_TEAM", "MUTE_PERMA", "MUTE_UNTIL", "UNMUTE_ERROR", "UNMUTE", UserPerm.TEAM), + Ban("BAN_TEAM", "BAN_PERMA", "BAN_UNTIL", "UNBAN_ERROR", "UNBAN", UserPerm.TEAM), + Mute("MUTE_TEAM", "MUTE_PERMA", "MUTE_UNTIL", "UNMUTE_ERROR", "UNMUTE", UserPerm.TEAM), NoSchemReceiving( - true, "NOSCHEMRECEIVING_TEAM", "NOSCHEMRECEIVING_PERMA", "NOSCHEMRECEIVING_UNTIL", @@ -146,7 +144,6 @@ class Punishment(id: EntityID) : IntEntity(id) { UserPerm.MODERATION ), NoSchemSharing( - true, "NOSCHEMSHARING_TEAM", "NOSCHEMSHARING_PERMA", "NOSCHEMSHARING_UNTIL", @@ -155,7 +152,6 @@ class Punishment(id: EntityID) : IntEntity(id) { UserPerm.MODERATION ), NoSchemSubmitting( - false, "NOSCHEMSUBMITTING_TEAM", "NOSCHEMSUBMITTING_PERMA", "NOSCHEMSUBMITTING_UNTIL", @@ -164,7 +160,6 @@ class Punishment(id: EntityID) : IntEntity(id) { UserPerm.TEAM ), NoDevServer( - true, "NODEVSERVER_TEAM", "NODEVSERVER_PERMA", "NODEVSERVER_UNTIL", @@ -173,7 +168,6 @@ class Punishment(id: EntityID) : IntEntity(id) { UserPerm.PREFIX_DEVELOPER ), NoFightServer( - true, "NOFIGHTSERVER_TEAM", "NOFIGHTSERVER_PERMA", "NOFIGHTSERVER_UNTIL", @@ -182,7 +176,6 @@ class Punishment(id: EntityID) : IntEntity(id) { UserPerm.MODERATION ), NoTeamServer( - true, "NOTEAMSERVER_TEAM", "NOTEAMSERVER_PERMA", "NOTEAMSERVER_UNTIL", @@ -190,9 +183,8 @@ class Punishment(id: EntityID) : IntEntity(id) { "UNNOTEAMSERVER", UserPerm.MODERATION ), - Note(false, "NOTE_TEAM", null, null, null, null, UserPerm.TEAM, true); + Note("NOTE_TEAM", null, null, null, null, UserPerm.TEAM, true); - fun isNeedsAdmin() = needsAdmin fun isMulti() = multi } } \ No newline at end of file