mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-26 20:06:28 -08:00
Fix automatic routing when no tracker is connected
This commit is contained in:
1 parent
08409660c4
commit
f6084e398e
1 file changed
+3
@@ -6,6 +6,7 @@ import kotlinx.coroutines.flow.combine
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.flow.emptyFlow
|
||||
import kotlinx.coroutines.flow.flatMapLatest
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
@@ -36,6 +37,8 @@ class BoneRoutingBasicBehaviour(private val appContext: AppContextProvider) : Bo
|
||||
server.context.state
|
||||
.map { it.trackers.values }
|
||||
.flatMapLatest { trackers ->
|
||||
if (trackers.isEmpty()) return@flatMapLatest flowOf(emptySet())
|
||||
|
||||
// Tracker state emits on every rotation packet, but only bodyPart/status matter here.
|
||||
// Dedup per tracker first, or combine gets resumed once per packet per tracker.
|
||||
combine(
|
||||
|
||||
Reference in new issue
Block a user