forked from SteamWar/SteamWar
Fix formatted team names disconnecting clients via click commands
This commit is contained in:
@@ -46,6 +46,10 @@ class Team(id: EntityID<Int>) : IntEntity(id) {
|
||||
fun byId(id: Int) =
|
||||
synchronized(teamCache) { teamCache.computeIfAbsent(id) { useDb { Team[id] } } }
|
||||
|
||||
@JvmStatic
|
||||
fun getActiveById(id: Int) =
|
||||
useDb { findById(id)?.takeUnless { it.deleted } }
|
||||
|
||||
@JvmStatic
|
||||
fun get(name: String) =
|
||||
useDb { find { (TeamTable.name.lowerCase() eq name.lowercase() or (TeamTable.kuerzel.lowerCase() eq name.lowercase())) and not(TeamTable.deleted) }.firstOrNull() }
|
||||
@@ -100,4 +104,4 @@ class Team(id: EntityID<Int>) : IntEntity(id) {
|
||||
set(value) = useDb {
|
||||
name = value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user