Handle SimulateScenario requests (#330)

* Handle SimulateScenario requests

* actually use sendLeave

* fix local test failures due to filehandle limit
This commit is contained in:
David Zhao
2022-01-11 00:37:24 -08:00
committed by GitHub
parent e82b8ea0a0
commit c2ba26eee6
10 changed files with 157 additions and 24 deletions
+7 -1
View File
@@ -78,7 +78,7 @@ func HandleParticipantSignal(room types.Room, participant types.Participant, req
return nil
}
case *livekit.SignalRequest_Leave:
_ = participant.Close()
_ = participant.Close(true)
case *livekit.SignalRequest_SubscriptionPermissions:
err := room.UpdateSubscriptionPermissions(participant, msg.SubscriptionPermissions)
if err != nil {
@@ -91,6 +91,12 @@ func HandleParticipantSignal(room types.Room, participant types.Participant, req
pLogger.Warnw("could not sync subscribe state", err,
"state", msg.SyncState)
}
case *livekit.SignalRequest_Simulate:
err := room.SimulateScenario(participant, msg.Simulate)
if err != nil {
pLogger.Warnw("could not simulate scenario", err,
"simulate", msg.Simulate)
}
}
return nil
}