diff --git a/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/sync/SyncManager.kt b/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/sync/SyncManager.kt index edef411b..5cc9d7db 100644 --- a/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/sync/SyncManager.kt +++ b/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/sync/SyncManager.kt @@ -2,6 +2,7 @@ package at.mocode.frontend.core.network.sync import at.mocode.frontend.core.network.discovery.NetworkDiscoveryService import kotlinx.coroutines.* +import kotlin.time.Duration.Companion.milliseconds /** * Manager, der mDNS Discovery und P2P Sync verbindet. @@ -35,7 +36,7 @@ class SyncManager( knownPeers.add(peerKey) } } - delay(5000) // Alle 5 Sekunden prüfen + delay(5000.milliseconds) // Alle 5 Sekunden prüfen } } } diff --git a/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/sync/JvmP2pSyncService.kt b/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/sync/JvmP2pSyncService.kt index 12bf5383..b0fc802f 100644 --- a/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/sync/JvmP2pSyncService.kt +++ b/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/sync/JvmP2pSyncService.kt @@ -1,20 +1,20 @@ package at.mocode.frontend.core.network.sync +import io.ktor.client.* +import io.ktor.client.plugins.websocket.* import io.ktor.server.application.* import io.ktor.server.engine.* import io.ktor.server.netty.* import io.ktor.server.routing.* import io.ktor.server.websocket.* import io.ktor.websocket.* -import io.ktor.client.* -import io.ktor.client.plugins.websocket.* -import kotlinx.coroutines.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.flow.* +import kotlinx.coroutines.launch import kotlinx.serialization.json.Json -import kotlinx.serialization.encodeToString -import kotlinx.serialization.decodeFromString -import java.util.Collections -import java.util.concurrent.ConcurrentHashMap +import java.util.* class JvmP2pSyncService : P2pSyncService { private var server: EmbeddedServer<*, *>? = null diff --git a/frontend/features/turnier-feature/src/commonMain/kotlin/at/mocode/turnier/feature/presentation/BewerbViewModel.kt b/frontend/features/turnier-feature/src/commonMain/kotlin/at/mocode/turnier/feature/presentation/BewerbViewModel.kt index 711fd275..7bb81f5d 100644 --- a/frontend/features/turnier-feature/src/commonMain/kotlin/at/mocode/turnier/feature/presentation/BewerbViewModel.kt +++ b/frontend/features/turnier-feature/src/commonMain/kotlin/at/mocode/turnier/feature/presentation/BewerbViewModel.kt @@ -1,10 +1,7 @@ package at.mocode.turnier.feature.presentation import at.mocode.frontend.core.network.discovery.DiscoveredService -import at.mocode.frontend.core.network.discovery.NetworkDiscoveryService import at.mocode.frontend.core.network.sync.SyncManager -import at.mocode.frontend.core.network.sync.SyncEvent -import at.mocode.frontend.core.network.sync.DataChangedEvent import at.mocode.turnier.feature.domain.Bewerb import at.mocode.turnier.feature.domain.BewerbRepository import at.mocode.turnier.feature.domain.StartlistenRepository diff --git a/frontend/features/turnier-feature/src/jvmMain/kotlin/at/mocode/turnier/feature/di/TurnierFeatureModule.kt b/frontend/features/turnier-feature/src/jvmMain/kotlin/at/mocode/turnier/feature/di/TurnierFeatureModule.kt index 7e402f72..76943ee0 100644 --- a/frontend/features/turnier-feature/src/jvmMain/kotlin/at/mocode/turnier/feature/di/TurnierFeatureModule.kt +++ b/frontend/features/turnier-feature/src/jvmMain/kotlin/at/mocode/turnier/feature/di/TurnierFeatureModule.kt @@ -1,6 +1,5 @@ package at.mocode.turnier.feature.di -import at.mocode.frontend.core.network.discovery.NetworkDiscoveryService import at.mocode.frontend.core.network.sync.SyncManager import at.mocode.turnier.feature.data.remote.DefaultAbteilungRepository import at.mocode.turnier.feature.data.remote.DefaultBewerbRepository