forked from SteamWar/SteamWar
Add SettingsCommand
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user