Resturcture bit

This commit is contained in:
DitFranXX 2021-05-10 12:08:05 +09:00
parent 530c83d7f5
commit 65ffaa5417
11 changed files with 80 additions and 25 deletions

View File

@ -1,9 +0,0 @@
mdb_ex.xml
mdb_mt.xml
mdb_nt.xml
mdb_hv.xml
mdb_ex.json
mdb_mt.json
mdb_nt.json
mdb_hv.json
custom_mdb.xml

View File

@ -1,4 +1,4 @@
import { getVersion } from ".";
import { getVersion } from "../utils";
interface EncoreStageData {
level: number
@ -11,7 +11,7 @@ export function getEncoreStageData(info: EamuseInfo): EncoreStageData {
switch (getVersion(info)) {
case 'nextage':
return {
level: 7,
level: 12 ,
musics: [ //TODO: check special encore works.
2587, 2531, 2612, 2622, 2686,
305, 602, 703, 802, 902, 1003, 1201, 1400, 1712, 1916, 2289, 2631, // DD13

9
gitadora@asphyxia/data/mdb/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
ex.xml
mt.xml
nt.xml
hv.xml
ex.json
mt.json
nt.json
hv.json
custom.xml

View File

@ -65,7 +65,7 @@ export function gameVerToDataVer(ver: string): DATAVersion {
export async function processDataBuilder(gameVer: string, processHandler?: processRawDataHandler) {
const ver = gameVerToDataVer(gameVer)
const base = `data/mdb_${ver}`
const base = `data/mdb/${ver}`
if (IO.Exists(`${base}.b64`)) {
return await readB64JSON(`${base}.b64`);
}

View File

@ -1,13 +1,13 @@
import { getVersion } from "../utils";
import { defaultProcessRawData, processDataBuilder } from "../data"
import { CommonMusicDataField, readJSONOrXML, readXML } from "../data";
import { defaultProcessRawData, processDataBuilder } from "../data/mdb"
import { CommonMusicDataField, readJSONOrXML, readXML } from "../data/mdb";
export const playableMusic: EPR = async (info, data, send) => {
const version = getVersion(info);
let music: CommonMusicDataField[] = [];
try {
if (U.GetConfig("enable_custom_mdb")) {
music = (await defaultProcessRawData('data/custom_mdb.xml')).music
music = (await defaultProcessRawData('data/mdb/custom.xml')).music
}
} catch (e) {
console.error(e.stack);

View File

@ -1,4 +1,4 @@
import { getEncoreStageData } from "../utils/extrastage";
import { getEncoreStageData } from "../data/extrastage";
export const shopInfoRegist: EPR = async (info, data, send) => {
send.object({
@ -55,6 +55,35 @@ export const gameInfoGet: EPR = async (info, data, send) => {
...obj,
box_term: {
state: K.ITEM('u8', 0)
},
box: {
pack: [
{
state: K.ITEM("u8", 1),
pack_kind: K.ITEM("s32", 0),
pack_id: K.ITEM("s32", 0),
item: [
{
index: K.ITEM("s32", 0),
item_kind: K.ITEM("s32", 0),
item_id: K.ITEM("s32", 2666),
item_param: K.ITEM("str", ""),
},
{
index: K.ITEM("s32", 1),
item_kind: K.ITEM("s32", 0),
item_id: K.ITEM("s32", 2624),
item_param: K.ITEM("str", ""),
},
{
index: K.ITEM("s32", 2),
item_kind: K.ITEM("s32", 0),
item_id: K.ITEM("s32", 2631),
item_param: K.ITEM("str", ""),
},
]
}
]
}
};
} else {
@ -77,7 +106,7 @@ export const gameInfoGet: EPR = async (info, data, send) => {
const extraData = getEncoreStageData(info)
await send.object({
now_date: K.ITEM('u64', time),
now_date: K.ITEM('u64', BigInt(Date.now())),
extra: {
extra_lv: K.ITEM('u8', extraData.level),
extramusic: {

View File

@ -391,11 +391,13 @@ export const getPlayer: EPR = async (info, data, send) => {
player: K.ATTR({ 'no': `${no}` }, {
now_date: K.ITEM('u64', time),
secretmusic: { // TODO: FIX THIS FOR STOP INFOS ON GAME END
music: {
musicid: K.ITEM('s32', 0),
seq: K.ITEM('u16', 255),
kind: K.ITEM('s32', 40),
},
music: _.merge(_.range(0,2800), _.range(5000, 5100)).map(mid => {
return {
musicid: K.ITEM('s32', mid),
seq: K.ITEM('u16', 255),
kind: K.ITEM('s32', 40),
}
}),
},
chara_list: {},
title_parts: {},
@ -524,10 +526,28 @@ export const getPlayer: EPR = async (info, data, send) => {
play_date_ms: K.ITEM("u64", BigInt(0))
},
lottery_result: {
unlock_bit: K.ITEM("u64", BigInt(0))
unlock_bit: K.ITEM("u64", BigInt(2305843009213693950)),
},
},
lotterybox: {
score_list: {
data: [
{
term: K.ITEM("u8", 0),
score: {
one_day_play_cnt: K.ITEM("s32", 0),
one_day_lottery_cnt: K.ITEM("s32", 0),
lucky_star: K.ITEM("s32", 0),
bear_mark: K.ITEM("s32", 0),
play_date_ms: K.ITEM("u64", BigInt(0))
},
lottery_result: {
unlock_bit: K.ITEM("u64", BigInt(2305843009213693950))
}
},
]
}
},
lotterybox: {},
...addition,
...playerData,
finish: K.ITEM('bool', 1),

View File

@ -21,7 +21,7 @@ export function register() {
default: false,
})
R.DataFile("data/custom_mdb.xml", {
R.DataFile("data/mdb/custom.xml", {
accept: ".xml",
name: "Custom MDB",
desc: "You need to enable Custom MDB option first."
@ -50,4 +50,10 @@ export function register() {
MultiRoute('cardutil.check', check);
MultiRoute('gametop.get', getPlayer);
MultiRoute('gameend.regist', savePlayer);
R.Unhandled(async (info, data, send) => {
if (["eventlog"].includes(info.module)) return;
console.error(`Received Unhandled Response on ${info.method} by ${info.model}/${info.module}`)
console.error(`Received Request: ${JSON.stringify(data, null, 4)}`)
})
}