feat(websocket)!: Implement WebSocket connection and event handling (#82)

Co-authored-by: LQ63 <lkhermann@web.de>
Reviewed-on: #82
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
2025-11-23 16:11:46 +01:00
committed by Janis
parent 1edb3bfd89
commit 8ca909db52
41 changed files with 2566 additions and 2763 deletions

View File

@@ -25,5 +25,5 @@ object GameUtil {
code.toString()
}
}

View File

@@ -0,0 +1,20 @@
package util
import de.knockoutwhist.utils.events.SimpleEvent
import tools.jackson.databind.json.JsonMapper
import tools.jackson.module.scala.ScalaModule
object WebsocketEventMapper {
private val scalaModule = ScalaModule.builder()
.addAllBuiltinModules()
.supportScala3Classes(true)
.build()
private val mapper = JsonMapper.builder().addModule(scalaModule).build()
def toJsonString(obj: SimpleEvent): String = {
mapper.writeValueAsString(obj)
}
}