正在显示
1 个修改的文件
包含
27 行增加
和
0 行删除
| @@ -62,6 +62,16 @@ constructor( | @@ -62,6 +62,16 @@ constructor( | ||
| 62 | RECONNECTING; | 62 | RECONNECTING; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | + /** | ||
| 66 | + * @suppress | ||
| 67 | + */ | ||
| 68 | + enum class SimulateScenario { | ||
| 69 | + SPEAKER_UPDATE, | ||
| 70 | + NODE_FAILURE, | ||
| 71 | + MIGRATION, | ||
| 72 | + SERVER_LEAVE; | ||
| 73 | + } | ||
| 74 | + | ||
| 65 | @JvmInline | 75 | @JvmInline |
| 66 | value class Sid(val sid: String) | 76 | value class Sid(val sid: String) |
| 67 | 77 | ||
| @@ -507,6 +517,23 @@ constructor( | @@ -507,6 +517,23 @@ constructor( | ||
| 507 | } | 517 | } |
| 508 | 518 | ||
| 509 | /** | 519 | /** |
| 520 | + * Sends a simulated scenario for the server to use. | ||
| 521 | + * | ||
| 522 | + * To be used for internal testing purposes only. | ||
| 523 | + * @suppress | ||
| 524 | + */ | ||
| 525 | + fun sendSimulateScenario(scenario: SimulateScenario) { | ||
| 526 | + val builder = LivekitRtc.SimulateScenario.newBuilder() | ||
| 527 | + when (scenario) { | ||
| 528 | + SimulateScenario.SPEAKER_UPDATE -> builder.speakerUpdate = 5 | ||
| 529 | + SimulateScenario.NODE_FAILURE -> builder.nodeFailure = true | ||
| 530 | + SimulateScenario.MIGRATION -> builder.migration = true | ||
| 531 | + SimulateScenario.SERVER_LEAVE -> builder.serverLeave = true | ||
| 532 | + } | ||
| 533 | + sendSimulateScenario(builder.build()) | ||
| 534 | + } | ||
| 535 | + | ||
| 536 | + /** | ||
| 510 | * @suppress | 537 | * @suppress |
| 511 | */ | 538 | */ |
| 512 | @AssistedFactory | 539 | @AssistedFactory |
-
请 注册 或 登录 后发表评论