diff --git a/gitadora@asphyxia/data/index.ts b/gitadora@asphyxia/data/index.ts index 64f650a..7814955 100644 --- a/gitadora@asphyxia/data/index.ts +++ b/gitadora@asphyxia/data/index.ts @@ -55,7 +55,7 @@ export function gameVerToDataVer(ver: string): DATAVersion { return DATAVersion.HIGHVOLTAGE case 'nextage': return DATAVersion.NEXTAGE - case 'excahin': + case 'exchain': return DATAVersion.EXCHAIN case 'matixx': default: diff --git a/gitadora@asphyxia/handlers/info.ts b/gitadora@asphyxia/handlers/info.ts index 339dbdd..f82dcec 100644 --- a/gitadora@asphyxia/handlers/info.ts +++ b/gitadora@asphyxia/handlers/info.ts @@ -1,3 +1,5 @@ +import { getEncoreStageData } from "../utils/extrastage"; + export const shopInfoRegist: EPR = async (info, data, send) => { send.object({ data: { @@ -72,16 +74,22 @@ export const gameInfoGet: EPR = async (info, data, send) => { } } + const extraData = getEncoreStageData(info) + const extraMusic = [] + for (const mid of extraData.musics ) { + extraMusic.push({ + musicid: K.ITEM('s32', mid), + get_border: K.ITEM('u8', 0), + }) + } + await send.object({ now_date: K.ITEM('u64', time), extra: { - extra_lv: K.ITEM('u8', 10), + extra_lv: K.ITEM('u8', extraData.level), extramusic: { - music: { - musicid: K.ITEM('s32', 0), - get_border: K.ITEM('u8', 0), - }, - }, + music: extraMusic, + } }, infect_music: { term: K.ITEM('u8', 0) }, unlock_challenge: { term: K.ITEM('u8', 0) }, diff --git a/gitadora@asphyxia/handlers/profiles.ts b/gitadora@asphyxia/handlers/profiles.ts index d6e8d08..f4819c0 100644 --- a/gitadora@asphyxia/handlers/profiles.ts +++ b/gitadora@asphyxia/handlers/profiles.ts @@ -390,7 +390,7 @@ export const getPlayer: EPR = async (info, data, send) => { send.object({ player: K.ATTR({ 'no': `${no}` }, { now_date: K.ITEM('u64', time), - secretmusic: { + secretmusic: { // TODO: FIX THIS FOR STOP INFOS ON GAME END music: { musicid: K.ITEM('s32', 0), seq: K.ITEM('u16', 255), @@ -926,7 +926,7 @@ export const savePlayer: EPR = async (info, data, send) => { scores[mid].update[1] = newSkill; } - scores[mid].diffs[seq] = { + scores[mid].diffs[seq] = { //FIXME: Real server is bit complicated. this one is too buggy. perc: Math.max(_.get(scores[mid].diffs[seq], 'perc', 0), perc), rank: Math.max(_.get(scores[mid].diffs[seq], 'rank', 0), rank), meter: meter.toString(), diff --git a/gitadora@asphyxia/utils/extrastage.ts b/gitadora@asphyxia/utils/extrastage.ts new file mode 100644 index 0000000..caf6aba --- /dev/null +++ b/gitadora@asphyxia/utils/extrastage.ts @@ -0,0 +1,28 @@ +import { getVersion } from "."; + +interface EncoreStageData { + level: number + musics: number[] +} + +export function getEncoreStageData(info: EamuseInfo): EncoreStageData { + const fallback = { level: 10, musics: [0] } + switch (getVersion(info)) { + case 'nextage': + return { + level: 7, + musics: [ + 2587, 2531, 2612, 2622, 2686, 2631, 2624, 2666 + ] + } + case 'exchain': + return { + level: 13, + musics: [ + 2498, 2513, 2500, 2529, 2546, 2549, 2548, 2560, 2568, 2576, 5020, 5032, 5031, 5033 + ] + } + default: + return fallback + } +} \ No newline at end of file diff --git a/gitadora@asphyxia/utils/index.ts b/gitadora@asphyxia/utils/index.ts index 10d4daa..f7a2db0 100644 --- a/gitadora@asphyxia/utils/index.ts +++ b/gitadora@asphyxia/utils/index.ts @@ -16,4 +16,4 @@ export function isRequiredCoreVersion(major: number, minor: number) { const core_major = typeof CORE_VERSION_MAJOR === "number" ? CORE_VERSION_MAJOR : 1 const core_minor = typeof CORE_VERSION_MINOR === "number" ? CORE_VERSION_MINOR : 18 return core_major >= major && core_minor >= minor -} \ No newline at end of file +};