Add server synchronization feature.

This commit is contained in:
Thomas Andres Gomez 2025-05-03 19:31:22 +02:00
parent 53c6aede27
commit fa49d8ed22
15 changed files with 154 additions and 48 deletions

View file

@ -10,7 +10,7 @@ import com.pixelized.shared.lwa.protocol.rest.CharacterPreviewJson
class CharacterSheetJsonFactory(
private val v1: CharacterSheetJsonV1Factory,
) {
suspend fun convertFromJson(
fun convertFromJson(
json: CharacterSheetJson,
): CharacterSheet {
return when (json) {

View file

@ -7,7 +7,7 @@ import com.pixelized.shared.lwa.usecase.CharacterSheetUseCase
class CharacterSheetJsonV1Factory(
private val characterSheetUseCase: CharacterSheetUseCase,
) {
suspend fun convertFromJson(
fun convertFromJson(
json: CharacterSheetJsonV1,
): CharacterSheet = characterSheetUseCase.run {
CharacterSheet(

View file

@ -0,0 +1,10 @@
package com.pixelized.shared.lwa.protocol.websocket
import kotlinx.serialization.Serializable
@Serializable
sealed interface GameAdminEvent : SocketMessage {
@Serializable
data class ServerSynchronization(override val timestamp: Long) : GameAdminEvent
}