Add SettingsCommand

This commit is contained in:
2026-04-02 10:05:35 +02:00
parent 2ad8cc3f4a
commit 08afee6f38
8 changed files with 117 additions and 52 deletions
@@ -254,12 +254,27 @@ class SteamwarUser(id: EntityID<Int>): IntEntity(id) {
punishments[punishment] = Punishment.createPunishment(this@SteamwarUser.id.value, from, punishment, reason, time, perma)
}
fun setLocale(locale: Locale?, manualeLocale: Boolean) {
if (locale == null || (this.manualLocale && !manualLocale)) return
fun setJoinLocale(locale: Locale?) {
if (locale == null || this.manualLocale) return
setCurrentLocale(locale)
}
fun setCurrentLocale(locale: Locale?) {
if (locale == null) return
useDb {
this@SteamwarUser.locale = locale
this@SteamwarUser.manualLocale = manualeLocale
}
}
fun lockLocale() {
useDb {
this@SteamwarUser.manualLocale = true
}
}
fun unlockLocale() {
useDb {
this@SteamwarUser.manualLocale = false
}
}
@@ -36,6 +36,8 @@ object TeamTable : IntIdTable("Team", "TeamID") {
class Team(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<Team>(TeamTable) {
const val PUBLIC: Int = 0
private val teamCache = mutableMapOf<Int, Team>()
@JvmStatic