Skip to content

Commit 6ccf909

Browse files
committed
tech: update patcher to test version
1 parent 54d8a5a commit 6ccf909

File tree

4 files changed

+45
-16
lines changed

4 files changed

+45
-16
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"@hyperplay/chains": "^0.5.0",
7373
"@hyperplay/check-disk-space": "^3.5.2",
7474
"@hyperplay/quests-ui": "^0.1.23",
75-
"@hyperplay/ui": "^1.9.5",
75+
"@hyperplay/ui": "^1.9.7",
7676
"@hyperplay/utils": "^0.3.7",
7777
"@mantine/carousel": "^7.12.0",
7878
"@mantine/core": "^7.12.0",
@@ -230,7 +230,7 @@
230230
"@hyperplay/extension-provider": "^0.0.9",
231231
"@hyperplay/mock-backend": "^0.0.1",
232232
"@hyperplay/overlay": "^1.0.0",
233-
"@hyperplay/patcher": "^0.0.21",
233+
"@hyperplay/patcher": "0.0.22-ebusy",
234234
"@hyperplay/providers": "^0.1.0",
235235
"@hyperplay/proxy-server": "^0.0.11"
236236
},

pnpm-lock.yaml

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/backend/main.ts

+3
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ if (!gotTheLock) {
683683
downloadAntiCheatData()
684684

685685
initTrayIcon(mainWindow)
686+
await downloadPatcher()
686687

687688
// Call checkGameUpdates for HyperPlay games every hour
688689
const checkGameUpdatesInterval = 1 * 60 * 60 * 1000
@@ -2125,3 +2126,5 @@ ipcMain.handle('getHyperPlayListings', async () => {
21252126
*/
21262127

21272128
import './storeManagers/legendary/eos_overlay/ipc_handler'
2129+
2130+
import { downloadPatcher } from 'backend/storeManagers/hyperplay/games'

src/backend/storeManagers/hyperplay/games.ts

+27-1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ import { ipfsGateway } from 'backend/vite_constants'
102102
import { GlobalConfig } from 'backend/config'
103103
import { PatchingError } from './types'
104104
import { SiweMessage } from 'siwe'
105+
import { isOnline } from 'backend/online_monitor'
105106

106107
interface ProgressDownloadingItem {
107108
DownloadItem: DownloadItem
@@ -1636,6 +1637,14 @@ function writeManifestFile(
16361637
}
16371638

16381639
export const downloadPatcher = async () => {
1640+
if (isOnline() === false) {
1641+
logWarning(
1642+
'No internet connection, skipping IPDT download.',
1643+
LogPrefix.HyperPlay
1644+
)
1645+
return
1646+
}
1647+
16391648
try {
16401649
const { downloadIPDTForOS } = await import('@hyperplay/patcher')
16411650
const versionFile = path.join(toolsPath, 'ipdt_version.txt')
@@ -1644,7 +1653,24 @@ export const downloadPatcher = async () => {
16441653
? readFileSync(versionFile, 'utf-8')
16451654
: undefined
16461655

1647-
await downloadIPDTForOS(toolsPath, currentVersion)
1656+
let attempts = 0
1657+
const maxAttempts = 10
1658+
while (attempts < maxAttempts) {
1659+
try {
1660+
await downloadIPDTForOS(toolsPath, currentVersion)
1661+
break
1662+
} catch (error) {
1663+
attempts++
1664+
if (attempts >= maxAttempts) {
1665+
throw error
1666+
}
1667+
logWarning(
1668+
`Retrying downloadIPDTForOS... Attempt ${attempts}`,
1669+
LogPrefix.HyperPlay
1670+
)
1671+
}
1672+
}
1673+
16481674
const version = await getIpdtPatcherVersion()
16491675

16501676
logInfo(`IPDT patcher ${version} setup successfully`, LogPrefix.HyperPlay)

0 commit comments

Comments
 (0)