mirror of https://github.com/hykilpikonna/AquaDX
[+] Hide allnet port
parent
5ed89754b3
commit
1a06033964
|
@ -13,6 +13,7 @@ billing.server.port=8443
|
||||||
## Please notice most games won't work with localhost or 127.0.0.1
|
## Please notice most games won't work with localhost or 127.0.0.1
|
||||||
#allnet.server.host=
|
#allnet.server.host=
|
||||||
#allnet.server.port=
|
#allnet.server.port=
|
||||||
|
allnet.server.hide-port=true
|
||||||
## This is for some games that use shop name for in-game functions.
|
## This is for some games that use shop name for in-game functions.
|
||||||
## Specify the place name here if you need it. By default it is empty.
|
## Specify the place name here if you need it. By default it is empty.
|
||||||
allnet.server.place-name=AquaDX
|
allnet.server.place-name=AquaDX
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.*
|
||||||
class AllNetProps {
|
class AllNetProps {
|
||||||
var host: String = ""
|
var host: String = ""
|
||||||
var port: Int? = null
|
var port: Int? = null
|
||||||
|
var hidePort: Boolean = true
|
||||||
val keychipSesExpire: Long = 172800000 // milliseconds
|
val keychipSesExpire: Long = 172800000 // milliseconds
|
||||||
var checkKeychip: Boolean = false
|
var checkKeychip: Boolean = false
|
||||||
var keychipPermissiveForTesting: Boolean = false
|
var keychipPermissiveForTesting: Boolean = false
|
||||||
|
@ -173,13 +174,13 @@ class AllNet(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun switchUri(localAddr: Str, localPort: Str, gameId: Str, ver: Str, session: Str?): Str {
|
private fun switchUri(localAddr: Str, localPort: Str, gameId: Str, ver: Str, session: Str?): Str {
|
||||||
val addr = props.host.ifBlank { localAddr }
|
val addr = props.host.ifBlank { localAddr } +
|
||||||
val port = props.port?.toString() ?: localPort
|
if (props.hidePort) "" else ":${props.port?.toString() ?: localPort}"
|
||||||
|
|
||||||
// If keychip authentication is enabled, the game URLs will be set to /gs/{token}/{game}/...
|
// If keychip authentication is enabled, the game URLs will be set to /gs/{token}/{game}/...
|
||||||
val base = if (session != null) "gs/$session" else "g"
|
val base = if (session != null) "gs/$session" else "g"
|
||||||
|
|
||||||
return "http://$addr:$port/$base/" + when (gameId) {
|
return "http://$addr/$base/" + when (gameId) {
|
||||||
"SDBT" -> "chu2/$ver/$session/"
|
"SDBT" -> "chu2/$ver/$session/"
|
||||||
"SDHD" -> "chu3/$ver/"
|
"SDHD" -> "chu3/$ver/"
|
||||||
"SDGS" -> "chu3/$ver/" // International (c3exp)
|
"SDGS" -> "chu3/$ver/" // International (c3exp)
|
||||||
|
|
Loading…
Reference in New Issue