Had to change a bunch to get everything to work but it should be working now

This commit is contained in:
2026-03-27 17:03:09 -07:00
parent 2bf42e7e7f
commit d107f85d6f
7 changed files with 104 additions and 30 deletions

View File

@@ -62,8 +62,13 @@ try {
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [INFO] Sent SaveReplayBuffer request (op 6)."
# Receive RequestResponse (opcode 7)
$null = $ws.ReceiveAsync($buffer, $cts.Token).Result
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [INFO] Received response (op 7)."
$recv = $ws.ReceiveAsync($buffer, $cts.Token).Result
$json = [System.Text.Encoding]::UTF8.GetString($buffer, 0, $recv.Count) | ConvertFrom-Json
$status = $json.d.requestStatus
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [INFO] Received response (op 7): result=$($status.result) code=$($status.code) comment=$($status.comment)"
if (-not $status.result) {
throw "OBS rejected SaveReplayBuffer: code=$($status.code) comment=$($status.comment)"
}
$ws.CloseAsync([System.Net.WebSockets.WebSocketCloseStatus]::NormalClosure, 'Done', $cts.Token).Wait()
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') [INFO] WebSocket closed. Save completed successfully."