Skip to content

Commit

Permalink
add render information to replay module
Browse files Browse the repository at this point in the history
  • Loading branch information
Himyu committed Dec 7, 2023
1 parent e35d0ac commit 0504118
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions electron/module/ReplayModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,22 @@ export class ReplayModule {

private async handleSandingPlayback() {
const fetchUri = ReplayModule.replayUrl + "playback"
const fetchUriRender = ReplayModule.replayUrl + "render"

try {
const res = await fetch(fetchUri, {
agent: httpsAgent,
useElectronNet: false
})
const resRender = await fetch(fetchUriRender, {
agent: httpsAgent,
useElectronNet: false
})

if (!res.ok) return
if (!res.ok || !resRender.ok) return

const json = await res.json()
const jsonRender = await resRender.json()
const savedAt = new Date().getTime() + this.server.prodTimeOffset
const time = Math.round(json.time)
const newData = {
Expand All @@ -320,7 +326,8 @@ export class ReplayModule {
version: 1
},
savedAt,
time
time,
data: jsonRender
})

this.isSynced = true
Expand Down

0 comments on commit 0504118

Please sign in to comment.