Format code

This commit is contained in:
2026-05-16 23:08:09 +02:00
parent 81dd8045f2
commit d110df924e
562 changed files with 11025 additions and 10059 deletions
+11 -6
View File
@@ -31,11 +31,15 @@ import kotlinx.serialization.Serializable
@Serializable
data class UserStats(val eventFightParticipation: Int, val eventParticipation: Int, val acceptedSchematics: Int, val fights: Int, val playtime: Double) {
constructor(user: SteamwarUser): this(
getEventFightParticipation(user) ?: 0,
getEventParticipation(user) ?: 0,
getAcceptedSchematics(user) ?: 0,
getFightCount(user) ?: 0,
constructor(user: SteamwarUser) : this(
getEventFightParticipation(user)
?: 0,
getEventParticipation(user)
?: 0,
getAcceptedSchematics(user)
?: 0,
getFightCount(user)
?: 0,
user.getOnlinetime() / 3600.0
)
}
@@ -43,7 +47,8 @@ data class UserStats(val eventFightParticipation: Int, val eventParticipation: I
fun Route.configureStats() {
route("/stats") {
get("/ranked/{gamemode}") {
val gamemode = call.parameters["gamemode"] ?: return@get call.respond(HttpStatusCode.NotFound)
val gamemode = call.parameters["gamemode"]
?: return@get call.respond(HttpStatusCode.NotFound)
@Serializable
data class RankedUser(val name: String, val elo: Int)