diff --git a/iidx@asphyxia/README.md b/iidx@asphyxia/README.md index d2710f6..13bb41a 100644 --- a/iidx@asphyxia/README.md +++ b/iidx@asphyxia/README.md @@ -32,8 +32,7 @@ Features - EVENT (Partial) - ARENA (LOCAL only) - RANDOME LANE TICKET - - FAVORITE/SONG SELECTION NOTES (Partial) - - EXTRA FAVORITE does not support yet + - FAVORITE/SONG SELECTION NOTES - ORIGINAL FILTER --- @@ -151,6 +150,7 @@ Changelogs **v0.1.16** - Added Initial support for EPOLIS - Added music\_open on gameSystem.systemInfo response + - Added EXTRA FAVORITE support - Fixed where lightning settings doesn't get saved on logout - Fixed where Disable Music Preview, Disable HCN Color, VEFX Lock settings doesn't reflect - Fixed where MISS COUNT has 0 as default (including score import) diff --git a/iidx@asphyxia/handlers/pc.ts b/iidx@asphyxia/handlers/pc.ts index f077c9d..02be8d1 100644 --- a/iidx@asphyxia/handlers/pc.ts +++ b/iidx@asphyxia/handlers/pc.ts @@ -11,6 +11,7 @@ import { tutorial } from "../models/tutorial"; import { expert } from "../models/ranking"; import { blueboss } from "../models/event"; import { badge } from "../models/badge"; +import { extra_favorite } from "../models/favorite"; export const pccommon: EPR = async (info, data, send) => { const version = GetVersion(info); @@ -523,6 +524,7 @@ export const pcget: EPR = async (info, data, send) => { const expert = await DB.Find(refid, { collection: "expert", version: version }); const world_tourism = await DB.Find(refid, { collection: "world_tourism", version: version }); const badge = await DB.Find(refid, { collection: "badge", version: version }); + const extra_favorite = await DB.Find(refid, { collection: "extra_favorite", version: version }); const lm_settings = await DB.FindOne(refid, { collection: "lightning_settings", version: version }); const lm_playdata = await DB.FindOne(refid, { collection: "lightning_playdata", version: version }); @@ -595,7 +597,7 @@ export const pcget: EPR = async (info, data, send) => { custom.hide_iidxid, custom.disable_beginner_option, ); - let dArray = [], eArray = [], rArray = [], mArray = [], bArray = [], fArray = [], fsArray = []; + let dArray = [], eArray = [], rArray = [], mArray = [], bArray = [], fArray = [], fsArray = [], efArray = []; grade.forEach((res: grade) => { dArray.push([res.style, res.gradeId, res.maxStage, res.archive]); @@ -794,8 +796,8 @@ export const pcget: EPR = async (info, data, send) => { }); } else if (version == 20) { - pcdata.st_stamp = _.isNil(pcdata.st_stamp) ? "00" : Buffer.from(pcdata.st_stamp, "base64").toString("hex"); - pcdata.st_help = _.isNil(pcdata.st_help) ? "00" : Buffer.from(pcdata.st_help, "base64").toString("hex"); + pcdata.st_stamp = _.isNil(pcdata.st_stamp) ? "00" : Buffer.from(pcdata.st_stamp as string, "base64").toString("hex"); + pcdata.st_help = _.isNil(pcdata.st_help) ? "00" : Buffer.from(pcdata.st_help as string, "base64").toString("hex"); let link5 = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "link5" }); let tricolettepark = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "tricolettepark" }); @@ -850,7 +852,7 @@ export const pcget: EPR = async (info, data, send) => { switch (version) { case 21: - pcdata.st_album = _.isNil(pcdata.st_album) ? "00" : Buffer.from(pcdata.st_album, "base64").toString("hex"); + pcdata.st_album = _.isNil(pcdata.st_album) ? "00" : Buffer.from(pcdata.st_album as string, "base64").toString("hex"); link5 = await DB.FindOne(refid, { collection: "event_1", version: 20, event_name: "link5" }); tricolettepark = await DB.FindOne(refid, { collection: "event_1", version: 20, event_name: "tricolettepark" }); @@ -859,7 +861,7 @@ export const pcget: EPR = async (info, data, send) => { if (!_.isNil(boss1)) boss1.durability = Buffer.from(boss1.durability, "base64").toString("hex"); break; case 22: - pcdata.st_album = _.isNil(pcdata.st_album) ? "00" : Buffer.from(pcdata.st_album, "base64").toString("hex"); + pcdata.st_album = _.isNil(pcdata.st_album) ? "00" : Buffer.from(pcdata.st_album as string, "base64").toString("hex"); chrono_diver = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "chrono_diver" }); pendual_talis = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "boss_event_3" }); @@ -871,7 +873,7 @@ export const pcget: EPR = async (info, data, send) => { qpronicle_phase3 = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "qpronicle_phase3" }); break; case 23: - pcdata.st_tokimeki = _.isNil(pcdata.st_tokimeki) ? "00" : Buffer.from(pcdata.st_tokimeki, "base64").toString("hex"); + pcdata.st_tokimeki = _.isNil(pcdata.st_tokimeki) ? "00" : Buffer.from(pcdata.st_tokimeki as string, "base64").toString("hex"); open_tokotoko = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "event1_data" }); mystery_line = await DB.FindOne(refid, { collection: "event_1", version: version, event_name: "event2_data" }); @@ -955,10 +957,23 @@ export const pcget: EPR = async (info, data, send) => { } if (!_.isNil(pcdata.sp_mlist)) { - pcdata.sp_mlist = Buffer.from(pcdata.sp_mlist, "base64").toString("hex"); - pcdata.sp_clist = Buffer.from(pcdata.sp_clist, "base64").toString("hex"); - pcdata.dp_mlist = Buffer.from(pcdata.dp_mlist, "base64").toString("hex"); - pcdata.dp_clist = Buffer.from(pcdata.dp_clist, "base64").toString("hex"); + pcdata.sp_mlist = Buffer.from(pcdata.sp_mlist as string, "base64").toString("hex"); + pcdata.sp_clist = Buffer.from(pcdata.sp_clist as string, "base64").toString("hex"); + pcdata.dp_mlist = Buffer.from(pcdata.dp_mlist as string, "base64").toString("hex"); + pcdata.dp_clist = Buffer.from(pcdata.dp_clist as string, "base64").toString("hex"); + } + + if (extra_favorite.length > 0) { + extra_favorite.forEach((res) => { + efArray.push({ + folder_id: res.folder_id, + + sp_mlist: Buffer.from(res.sp_mlist as string, "base64").toString("hex"), + sp_clist: Buffer.from(res.sp_clist as string, "base64").toString("hex"), + dp_mlist: Buffer.from(res.dp_mlist as string, "base64").toString("hex"), + dp_clist: Buffer.from(res.dp_clist as string, "base64").toString("hex") + }); + }); } if (version >= 30) { @@ -1222,6 +1237,7 @@ export const pcget: EPR = async (info, data, send) => { case 23: result = { ...result, + efArray, open_tokotoko, mystery_line, mystery_line_sub, @@ -1230,6 +1246,7 @@ export const pcget: EPR = async (info, data, send) => { case 24: result = { ...result, + efArray, siege_sinobuz, siege_sinobuz_sub, ninja_shichikyoden, @@ -1238,6 +1255,7 @@ export const pcget: EPR = async (info, data, send) => { case 25: result = { ...result, + efArray, rush_cannonracer, rush_cannonracer_sub, }; @@ -2661,6 +2679,27 @@ export const pcsave: EPR = async (info, data, send) => { pcdata.dp_clist = $(data).element("favorite").buffer("dp_clist").toString("base64"); } + let extra_favorite = $(data).elements("extra_favorite"); + if (extra_favorite.length > 0) { + extra_favorite.forEach((res) => { + DB.Upsert(refid, + { + collection: "extra_favorite", + version: version, + folder_id: Number(res.attr().folder_id), + }, + { + $set: { + sp_mlist: res.buffer("sp_mlist").toString("base64"), + sp_clist: res.buffer("sp_clist").toString("base64"), + dp_mlist: res.buffer("dp_mlist").toString("base64"), + dp_clist: res.buffer("dp_clist").toString("base64") + }, + } + ); + }); + } + if (!_.isNil($(data).element("qpro_secret"))) { custom.qpro_secret_head = $(data).element("qpro_secret").bigints("head").map(String); custom.qpro_secret_hair = $(data).element("qpro_secret").bigints("hair").map(String); @@ -2831,6 +2870,27 @@ export const pcsave: EPR = async (info, data, send) => { pcdata.dp_clist = $(data).element("favorite").buffer("dp_clist").toString("base64"); } + let extra_favorite = $(data).elements("extra_favorite"); + if (extra_favorite.length > 0) { + extra_favorite.forEach((res) => { + DB.Upsert(refid, + { + collection: "extra_favorite", + version: version, + folder_id: Number(res.attr().folder_id), + }, + { + $set: { + sp_mlist: res.buffer("sp_mlist").toString("base64"), + sp_clist: res.buffer("sp_clist").toString("base64"), + dp_mlist: res.buffer("dp_mlist").toString("base64"), + dp_clist: res.buffer("dp_clist").toString("base64") + }, + } + ); + }); + } + if (!_.isNil($(data).element("qpro_secret"))) { custom.qpro_secret_head = $(data).element("qpro_secret").bigints("head").map(String); custom.qpro_secret_hair = $(data).element("qpro_secret").bigints("hair").map(String); @@ -3018,6 +3078,27 @@ export const pcsave: EPR = async (info, data, send) => { pcdata.dp_clist = $(data).element("favorite").buffer("dp_clist").toString("base64"); } + let extra_favorite = $(data).elements("extra_favorite"); + if (extra_favorite.length > 0) { + extra_favorite.forEach((res) => { + DB.Upsert(refid, + { + collection: "extra_favorite", + version: version, + folder_id: Number(res.attr().folder_id), + }, + { + $set: { + sp_mlist: res.buffer("sp_mlist").toString("base64"), + sp_clist: res.buffer("sp_clist").toString("base64"), + dp_mlist: res.buffer("dp_mlist").toString("base64"), + dp_clist: res.buffer("dp_clist").toString("base64") + }, + } + ); + }); + } + if (!_.isNil($(data).element("qpro_secret"))) { custom.qpro_secret_head = $(data).element("qpro_secret").bigints("head").map(String); custom.qpro_secret_hair = $(data).element("qpro_secret").bigints("hair").map(String); @@ -3182,13 +3263,6 @@ export const pcsave: EPR = async (info, data, send) => { pcdata.secret_flg3 = $(data).element("secret").bigints("flg3").map(String); } - if (!_.isNil($(data).element("favorite"))) { - pcdata.sp_mlist = $(data).element("favorite").buffer("sp_mlist").toString("base64"); - pcdata.sp_clist = $(data).element("favorite").buffer("sp_clist").toString("base64"); - pcdata.dp_mlist = $(data).element("favorite").buffer("dp_mlist").toString("base64"); - pcdata.dp_clist = $(data).element("favorite").buffer("dp_clist").toString("base64"); - } - if (!_.isNil($(data).element("qpro_secret"))) { custom.qpro_secret_head = $(data).element("qpro_secret").bigints("head").map(String); custom.qpro_secret_hair = $(data).element("qpro_secret").bigints("hair").map(String); diff --git a/iidx@asphyxia/models/favorite.ts b/iidx@asphyxia/models/favorite.ts new file mode 100644 index 0000000..0837c26 --- /dev/null +++ b/iidx@asphyxia/models/favorite.ts @@ -0,0 +1,10 @@ +export interface extra_favorite { + collection: "extra_favorite"; + version: number; + folder_id: number; + + sp_mlist: string | Buffer; + sp_clist: string | Buffer; + dp_mlist: string | Buffer; + dp_clist: string | Buffer; +} diff --git a/iidx@asphyxia/models/pcdata.ts b/iidx@asphyxia/models/pcdata.ts index 61f8018..78dab35 100644 --- a/iidx@asphyxia/models/pcdata.ts +++ b/iidx@asphyxia/models/pcdata.ts @@ -143,8 +143,8 @@ export interface pcdata { st_sp_round: number; st_dp_round: number; st_review: number; - st_stamp: any; - st_help: any; // save as base64 string, sent as buffer // + st_stamp: string | Buffer; // save as base64 string, sent as buffer // + st_help: string | Buffer; st_damage: number; // SPADA // st_defeat: number; @@ -156,7 +156,7 @@ export interface pcdata { st_sp_mplay: number; st_dp_mplay: number; st_last_select: number; - st_album: any; + st_album: string | Buffer; // save as base64 string, sent as buffer // st_is_secret: number; // PENDUAL // st_age_list: number; @@ -167,7 +167,7 @@ export interface pcdata { st_station_clear: number; st_station_play: number; st_mission_gauge: number; - st_tokimeki: any; + st_tokimeki: string | Buffer; // save as base64 string, sent as buffer // st_point: number; // Cannon Ballers // @@ -208,10 +208,10 @@ export interface pcdata { p3: number[]; p4: number[]; - sp_mlist: any; // favorite (SPADA), save as base64 string, sent as buffer // - sp_clist: any; - dp_mlist: any; - dp_clist: any; + sp_mlist: string | Buffer; // favorite (SPADA), save as base64 string, sent as buffer // + sp_clist: string | Buffer; + dp_mlist: string | Buffer; + dp_clist: string | Buffer; eb_keyorb: number; // extra boss (Heroic Verse) // eb_bossorb0: number; diff --git a/iidx@asphyxia/pug/LDJ/23pcget.pug b/iidx@asphyxia/pug/LDJ/23pcget.pug index 1552783..55210e4 100644 --- a/iidx@asphyxia/pug/LDJ/23pcget.pug +++ b/iidx@asphyxia/pug/LDJ/23pcget.pug @@ -13,6 +13,12 @@ IIDX23pc(status="0") sp_clist(__type="bin") #{pcdata.sp_clist} dp_mlist(__type="bin") #{pcdata.dp_mlist} dp_clist(__type="bin") #{pcdata.dp_clist} + - for (let ef of efArray) + extra_favorite(folder_id=ef.folder_id) + sp_mlist(__type="bin") #{ef.sp_mlist} + sp_clist(__type="bin") #{ef.sp_clist} + dp_mlist(__type="bin") #{ef.dp_mlist} + dp_clist(__type="bin") #{ef.dp_clist} qpro_secret head(__type="s64" __count="4") -1 -1 -1 -1 hair(__type="s64" __count="4") -1 -1 -1 -1 diff --git a/iidx@asphyxia/pug/LDJ/24pcget.pug b/iidx@asphyxia/pug/LDJ/24pcget.pug index 42e7828..b4d6889 100644 --- a/iidx@asphyxia/pug/LDJ/24pcget.pug +++ b/iidx@asphyxia/pug/LDJ/24pcget.pug @@ -14,6 +14,12 @@ IIDX24pc(status="0") sp_clist(__type="bin") #{pcdata.sp_clist} dp_mlist(__type="bin") #{pcdata.dp_mlist} dp_clist(__type="bin") #{pcdata.dp_clist} + - for (let ef of efArray) + extra_favorite(folder_id=ef.folder_id) + sp_mlist(__type="bin") #{ef.sp_mlist} + sp_clist(__type="bin") #{ef.sp_clist} + dp_mlist(__type="bin") #{ef.dp_mlist} + dp_clist(__type="bin") #{ef.dp_clist} qpro_secret head(__type="s64" __count="4") -1 -1 -1 -1 hair(__type="s64" __count="4") -1 -1 -1 -1 diff --git a/iidx@asphyxia/pug/LDJ/25pcget.pug b/iidx@asphyxia/pug/LDJ/25pcget.pug index 769253c..8c6bf22 100644 --- a/iidx@asphyxia/pug/LDJ/25pcget.pug +++ b/iidx@asphyxia/pug/LDJ/25pcget.pug @@ -14,6 +14,12 @@ IIDX25pc(status="0") sp_clist(__type="bin") #{pcdata.sp_clist} dp_mlist(__type="bin") #{pcdata.dp_mlist} dp_clist(__type="bin") #{pcdata.dp_clist} + - for (let ef of efArray) + extra_favorite(folder_id=ef.folder_id) + sp_mlist(__type="bin") #{ef.sp_mlist} + sp_clist(__type="bin") #{ef.sp_clist} + dp_mlist(__type="bin") #{ef.dp_mlist} + dp_clist(__type="bin") #{ef.dp_clist} qpro_secret head(__type="s64" __count="4") -1 -1 -1 -1 hair(__type="s64" __count="4") -1 -1 -1 -1