Update dependencies.

This commit is contained in:
Oliver Rümpelein 2023-04-08 21:57:38 +02:00
parent 59c8cae39b
commit ed5716875f
14 changed files with 27 additions and 20 deletions

View file

@ -1,6 +1,6 @@
ktor_version=2.0.1
kotlin_version=1.6.20
logback_version=1.2.11
kotlinx_html_version=0.7.5
shadowjar_version=7.1.2
ktor_version=2.2.4
kotlin_version=1.8.20
logback_version=1.4.6
kotlinx_html_version=0.8.0
shadowjar_version=8.1.1
kotlin.code.style=official

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -2,12 +2,15 @@ package de.pheerai.buzzer
import de.pheerai.buzzer.routing.configureRoutes
import de.pheerai.buzzer.setup.setupPlugins
import io.ktor.server.application.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
fun main() {
embeddedServer(Netty, port = 8888, host = "0.0.0.0") {
embeddedServer(Netty, port = 8888, host = "0.0.0.0", module = Application::myApplicationModule).start(wait = true)
}
fun Application.myApplicationModule() {
setupPlugins()
configureRoutes()
}.start(wait = true)
}

View file

@ -10,5 +10,6 @@ open class TEMPLATE(
@HtmlTagMarker
inline fun FlowContent.template(classes: String? = null, crossinline block: TEMPLATE.() -> Unit = {}): Unit = TEMPLATE(
attributesMapOf("class", classes), consumer
attributesMapOf("class", classes),
consumer,
).visit(block)

View file

@ -10,12 +10,12 @@ fun HTML.createGameModeratorDocument() {
link(
href = "/assets/colors.css",
rel = "stylesheet",
type = "text/css"
type = "text/css",
)
link(
href = "/assets/gamemoderator.css",
rel = "stylesheet",
type = "text/css"
type = "text/css",
)
script {
src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
@ -37,7 +37,7 @@ fun HTML.createGameModeratorDocument() {
receivedNames.push(ev.data)
});
}
""".trimIndent()
""".trimIndent(),
)
xEffect(
//language=JavaScript
@ -47,7 +47,7 @@ fun HTML.createGameModeratorDocument() {
} else {
Alpine.data.buzzerWebSocket.send("CLEAR:");
}
""".trimIndent()
""".trimIndent(),
)
div(classes = "parent") {
div(classes = "player") {
@ -73,7 +73,7 @@ fun HTML.createGameModeratorDocument() {
clicked = true
setTimeout(() => {clicked = false}, 50)
}
""".trimIndent()
""".trimIndent(),
)
xOn("mousedown", "clicked = true")
xOn("touchstart", "clicked = true")

View file

@ -10,12 +10,12 @@ fun HTML.createPlayerDocument() {
link(
href = "/assets/colors.css",
rel = "stylesheet",
type = "text/css"
type = "text/css",
)
link(
href = "/assets/player.css",
rel = "stylesheet",
type = "text/css"
type = "text/css",
)
script {
src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
@ -48,7 +48,7 @@ fun HTML.createPlayerDocument() {
}
});
}
""".trimIndent()
""".trimIndent(),
)
div(classes = "input") {
label { +"Player" }
@ -78,7 +78,7 @@ fun HTML.createPlayerDocument() {
clicked = false
}, 50)
}
""".trimMargin()
""".trimMargin(),
)
xOn("mousedown", "clicked = true")
xOn("touchstart", "clicked = true")

View file

@ -4,5 +4,6 @@ import io.ktor.websocket.*
@JvmInline
value class PlayerSocket(val session: WebSocketSession)
@JvmInline
value class GameModeratorSocket(val session: WebSocketSession)

View file

@ -7,4 +7,6 @@ module buzzer {
requires io.ktor.server.core;
requires io.ktor.server.websockets;
requires io.ktor.server.html.builder;
requires io.ktor.server.host.common;
requires io.ktor.server.netty;
}