Had to change a bunch to get everything to work but it should be working now
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user