mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
fix: list Battle.net games installed under Blizzard's China uids
Blizzard's China client records some products under a CN uid, so the installs it makes never reach the Library and their Stores card keeps offering Install: Diablo II: Resurrected osic (catalogue had osi) StarCraft II s2_cn (catalogue had s2) Diablo Immortal anbs_cn (catalogue had anbs) title() now resolves those uids to the international title, so the Library, the Stores "installed" state, the cover folder and the launch code all agree, while Game.installUid keeps the uid the Agent recorded for updates and uninstalls. TITLES and STORE are untouched.
This commit is contained in:
1 parent
1c24c600cd
commit
969b7e625f
2 files changed
+25
-1
No files matched your search
@@ -259,6 +259,7 @@ class BattleNetTest {
|
||||
BattleNet.hostFolder(context, "Z:/root/Games/Stores/Battle.net/Hearthstone/"))
|
||||
}
|
||||
|
||||
|
||||
@Test fun wowForeverIsListedBesideRetailInTheSharedWorldOfWarcraftFolder() {
|
||||
val pfx = File(BattleNet.prefix(context), "pfx").apply { mkdirs() }
|
||||
val wow = File(pfx, "drive_c/Program Files (x86)/World of Warcraft").apply { mkdirs() }
|
||||
@@ -329,6 +330,24 @@ class BattleNetTest {
|
||||
assertEquals(listOf(File(wow, "_forever_")), BattleNet.games(context).map { it.folder })
|
||||
db.writeBytes(message(forever, retail))
|
||||
assertEquals(listOf(File(wow, "_forever_"), wow), BattleNet.games(context).map { it.folder })
|
||||
|
||||
@Test fun aGameInstalledUnderBlizzardsChineseUidIsStillListed() {
|
||||
val pfx = File(BattleNet.prefix(context), "pfx").apply { mkdirs() }
|
||||
File(pfx, "drive_c/ProgramData/Battle.net/Agent").mkdirs()
|
||||
File(pfx, "drive_c/ProgramData/Battle.net/Agent/product.db").writeBytes(message(
|
||||
field(1, message(field(1, "osic"), field(3, message(field(1, "Z:/root/Games/Stores/Battle.net/Diablo II Resurrected"))))),
|
||||
field(1, message(field(1, "s2_cn"), field(3, message(field(1, "Z:/root/Games/Stores/Battle.net/StarCraft II"))))),
|
||||
))
|
||||
for (folder in listOf("Diablo II Resurrected", "StarCraft II")) {
|
||||
File(LinuxRuntime.rootDir(context), "root/Games/Stores/Battle.net/$folder").mkdirs()
|
||||
}
|
||||
val games = BattleNet.games(context)
|
||||
assertEquals(listOf("osic", "s2_cn"), games.map { it.installUid })
|
||||
assertEquals(listOf("osi", "s2"), games.map { it.uid })
|
||||
assertEquals(listOf("Diablo II: Resurrected" to "OSI", "StarCraft II" to "S2"), games.map { it.name to it.code })
|
||||
assertFalse(BattleNet.notInstalled(BattleNet.title("osi")!!, listOf("osic")))
|
||||
assertFalse(BattleNet.notInstalled(BattleNet.title("s2")!!, games.map { it.installUid }))
|
||||
|
||||
}
|
||||
|
||||
@Test fun aGamesShortcutHasBattleNetLaunchItInItsPrefix() {
|
||||
|
||||
Reference in new issue
Block a user