mirror of https://github.com/hykilpikonna/AquaDX
[+] Game music popularity for chusan
parent
ef8cb7e0ee
commit
208fb8cf73
|
@ -6,6 +6,7 @@ import icu.samnyan.aqua.net.utils.simpleDescribe
|
||||||
import icu.samnyan.aqua.sega.allnet.TokenChecker
|
import icu.samnyan.aqua.sega.allnet.TokenChecker
|
||||||
import icu.samnyan.aqua.sega.chusan.handler.chusanInit
|
import icu.samnyan.aqua.sega.chusan.handler.chusanInit
|
||||||
import icu.samnyan.aqua.sega.chusan.model.Chu3Repos
|
import icu.samnyan.aqua.sega.chusan.model.Chu3Repos
|
||||||
|
import icu.samnyan.aqua.sega.general.GameMusicPopularity
|
||||||
import icu.samnyan.aqua.sega.general.MeowApi
|
import icu.samnyan.aqua.sega.general.MeowApi
|
||||||
import icu.samnyan.aqua.sega.general.RequestContext
|
import icu.samnyan.aqua.sega.general.RequestContext
|
||||||
import icu.samnyan.aqua.sega.util.jackson.BasicMapper
|
import icu.samnyan.aqua.sega.util.jackson.BasicMapper
|
||||||
|
@ -28,7 +29,8 @@ class ChusanController(
|
||||||
val db: Chu3Repos,
|
val db: Chu3Repos,
|
||||||
val us: AquaUserServices,
|
val us: AquaUserServices,
|
||||||
val versionHelper: ChusanVersionHelper,
|
val versionHelper: ChusanVersionHelper,
|
||||||
val props: ChusanProps
|
val props: ChusanProps,
|
||||||
|
val pop: GameMusicPopularity,
|
||||||
): MeowApi({ api, resp ->
|
): MeowApi({ api, resp ->
|
||||||
if (resp is String) resp
|
if (resp is String) resp
|
||||||
else (if ("CM" in api) cmMapper else mapper).write(resp)
|
else (if ("CM" in api) cmMapper else mapper).write(resp)
|
||||||
|
|
|
@ -16,8 +16,17 @@ fun ChusanController.chusanInit() {
|
||||||
cmApiInit()
|
cmApiInit()
|
||||||
upsertApiInit()
|
upsertApiInit()
|
||||||
|
|
||||||
|
// Game music popularity
|
||||||
|
"GetGameRanking" {
|
||||||
|
val type = parsing { data["type"]!!.int }
|
||||||
|
|
||||||
|
// TODO: figure out what type does
|
||||||
|
mapOf("type" to type, "length" to 0, "gameRankingList" to (pop.ranking["chusan"] ?: listOf()).map {
|
||||||
|
mapOf("id" to it.musicId, "point" to it.weight)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Stub handlers
|
// Stub handlers
|
||||||
"GetGameRanking" { """{"type":"${data["type"]}","length":"0","gameRankingList":[]}""" }
|
|
||||||
"GetGameIdlist" { """{"type":"${data["type"]}","length":"0","gameIdlistList":[]}""" }
|
"GetGameIdlist" { """{"type":"${data["type"]}","length":"0","gameIdlistList":[]}""" }
|
||||||
|
|
||||||
"GetTeamCourseSetting" { """{"userId":"${data["userId"]}","length":"0","nextIndex":"0","teamCourseSettingList":[]}""" }
|
"GetTeamCourseSetting" { """{"userId":"${data["userId"]}","length":"0","nextIndex":"0","teamCourseSettingList":[]}""" }
|
||||||
|
|
Loading…
Reference in New Issue