Starting...

This commit is contained in:
2025-10-27 18:34:31 +01:00
parent e6bbb76a0b
commit a462231bab
65 changed files with 784 additions and 772 deletions
@@ -46,7 +46,7 @@ data class ResponseSchematicType(val name: String, val db: String)
data class ResponseUser(val name: String, val uuid: String, val prefix: String, val perms: List<String>) {
constructor(user: SteamwarUser) : this(user.userName, user.uuid.toString(), user.prefix().chatPrefix, user.perms().filter { !it.name.startsWith("PREFIX_") }.map { it.name }) {
synchronized(cache) {
cache[user.id] = this
cache[user.getId()] = this
}
}
@@ -55,7 +55,7 @@ data class ResponseUser(val name: String, val uuid: String, val prefix: String,
fun get(id: Int): ResponseUser {
synchronized(cache) {
return cache[id] ?: ResponseUser(SteamwarUser.get(id)).also { cache[id] = it }
return cache[id] ?: ResponseUser(SteamwarUser.byId(id)!!).also { cache[id] = it }
}
}
@@ -75,7 +75,7 @@ fun Route.configureDataRoutes() {
permission = UserPerm.MODERATION
}
get("/users") {
call.respond(SteamwarUser.getAll().map { ResponseUser(it) })
call.respond(SteamwarUser.all().map { ResponseUser(it) })
}
get("/teams") {
call.respond(Team.getAll().map { ResponseTeam(it) })