Merge branch 'broker' into v1-dev

This commit is contained in:
Azalea
2025-03-21 19:47:35 -04:00
49 changed files with 528 additions and 153 deletions

View File

@@ -3,6 +3,7 @@ package icu.samnyan.aqua.net.transfer
import ext.header
import ext.post
import ext.request
import java.net.URI
import icu.samnyan.aqua.sega.aimedb.AimeDbClient
import icu.samnyan.aqua.sega.allnet.AllNetBillingDecoder
import icu.samnyan.aqua.sega.allnet.AllNetBillingDecoder.decodeAllNetResp
@@ -23,7 +24,7 @@ class AllNetClient(val dns: String, val keychip: String, val game: String, val v
if (keychip.length == 11) keychip
else keychip.substring(0, 4) + keychip.substring(5, 12)
}
val aime by lazy { AimeDbClient(game, keychipShort, dns.substringAfter("://").substringBefore(":").substringBefore("/")) }
val aime by lazy { AimeDbClient(game, keychipShort, URI(dns).host) }
// Send AllNet PowerOn request to obtain game URL
val gameUrl by lazy {
@@ -38,9 +39,6 @@ class AllNetClient(val dns: String, val keychip: String, val game: String, val v
"ip" to "127.0.0.1", "firm_ver" to "60001", "boot_ver" to "0000",
"encode" to "UTF-8", "format_ver" to "3", "hops" to "1", "token" to "2864179931"
)))
?.also {
println(it)
}
?.decodeAllNetResp()?.get("uri")
?: throw Exception("PowerOn Failed: No game URL returned")
}