From 55b42f5c61e1e3493fd08c125fc34b76c7abc553 Mon Sep 17 00:00:00 2001 From: Sora <34794115+sorae42@users.noreply.github.com> Date: Mon, 9 Sep 2024 22:23:55 +0700 Subject: [PATCH] update to v1.4.4_a12 --- README.md | 2 +- data/customlist.ts | 7 ++ handlers/IIDXpc.ts | 195 +++++++++++++++++++++++++++---------- handlers/webui.ts | 23 ++++- index.ts | 7 +- models/settings.ts | 2 + pug/31get.pug | 7 +- pug/31systeminfo.pug | 5 +- util.ts | 4 +- webui/profile_export.pug | 15 +++ webui/profile_settings.pug | 13 ++- 11 files changed, 221 insertions(+), 59 deletions(-) create mode 100644 webui/profile_export.pug diff --git a/README.md b/README.md index a0e9e04..0156b73 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # IIDX -Plugin Version: **v1.4.4_a8** +Plugin Version: **v1.4.4_a12** This is A Core IIDX Plugin. diff --git a/data/customlist.ts b/data/customlist.ts index f6c1e4b..f9bb276 100644 --- a/data/customlist.ts +++ b/data/customlist.ts @@ -5,6 +5,13 @@ export const frame_list: string[] = [ "デフォルト", + "BPLS4 APINA VRAMeS", + "BPLS4 GiGO", + "BPLS4 GAME PANIC", + "BPLS4 SILK HAT", + "BPLS4 TAITO STATION Tradz", + "BPLS4 ROUND1", + "BPLS4 レジャーランド", ]; export const menumusic_list: string[] = [ diff --git a/handlers/IIDXpc.ts b/handlers/IIDXpc.ts index 5f920a6..3dde804 100644 --- a/handlers/IIDXpc.ts +++ b/handlers/IIDXpc.ts @@ -322,6 +322,22 @@ export const pcget: EPR = async (info, data, send) => { break; } } + + if (_.isNil(settings.disable_basicoption)) { + await DB.Upsert(refid, + { + collection: "settings", + }, + { + $set: { + disable_basicoption: false, + } + } + ); + + settings.disable_basicoption = false; + } + const appendsetting = AppendSettingConverter( settings.score_folders, settings.clear_folders, @@ -334,12 +350,11 @@ export const pcget: EPR = async (info, data, send) => { settings.disable_graphcutin, settings.classic_hispeed, settings.rival_played, - settings.hide_iidxid + settings.hide_iidxid, + settings.disable_basicoption, ); let rivals = await DB.Find(refid, { collection: "rival" }); let world_tourism = await DB.Find(refid, { collection: "world_tourism" }); - let event_1 = await DB.Find(refid, { collection: "event_1", version: version }); - let event_1s = await DB.Find(refid, { collection: "event_1_sub", version: version }); let lightning_settings = await DB.FindOne(refid, { collection: "lightning_settings", version: version }); let lightning_playdata = await DB.FindOne(refid, { collection: "lightning_playdata", version: version }); @@ -662,44 +677,25 @@ export const pcget: EPR = async (info, data, send) => { // event_1 // let evtArray = [], evtArray2 = [], evtArray3 = []; if (version == 31) { - event_1.forEach((evt: any) => { - evtArray.push({ - map_id: evt.map_id, + let myepo_map = await DB.Find(refid, { collection: "event_1", version: version, event_data: "myepo_map" }); + let myepo_building = await DB.Find(refid, { collection: "event_1_sub", version: version, event_data: "myepo_building" }); + let myepo_shop = await DB.Find(refid, { collection: "event_1_sub", version: version, event_data: "myepo_shop" }); - play_num: evt.play_num, - play_num_uc: evt.play_num_uc, - last_select_pos: evt.last_select_pos, - map_prog: evt.map_prog, - gauge: evt.gauge, - tile_num: evt.tile_num, - metron_total_get: evt.metron_total_get, - metron_total_use: evt.metron_total_use, - bank_date: evt.bank_date, - grade_bonus: evt.grade_bonus, - end_bonus: evt.end_bonus, + myepo_map.forEach((res: any) => { + let data = { + ...res, carryover_use: 0, - }); + }; - evt.buildingArray.forEach((res) => { - evtArray2.push({ - map_id: evt.map_id, - - pos: res.pos, - building: res.building, - use_tile: res.use_tile, - }); - }); - - evt.shopArray.forEach((res) => { - evtArray3.push({ - map_id: evt.map_id, - - reward_id: res.reward_id, - prog: res.prog, - }); - }); + evtArray.push(data); }); + + evtArray2 = myepo_building; + evtArray3 = myepo_shop; } else { + let event_1 = await DB.Find(refid, { collection: "event_1", version: version }); + let event_1s = await DB.Find(refid, { collection: "event_1_sub", version: version }); + if (event_1.length > 0) { for (let evt of event_1) { evtArray.push(evt); @@ -778,6 +774,9 @@ export const pcget: EPR = async (info, data, send) => { evtArray2, }); } else if (version == 31) { + let epores = await DB.FindOne(refid, { collection: "event_1", version: version, event_data: "epores" }); + let epores_data = await DB.Find(refid, { collection: "event_1_sub", version: version, event_data: "epores_system" }); + send.pugFile("pug/31get.pug", { profile, settings, @@ -795,6 +794,8 @@ export const pcget: EPR = async (info, data, send) => { evtArray, evtArray2, evtArray3, + epores, + epores_data, }); } } @@ -1087,7 +1088,7 @@ export const pcsave: EPR = async (info, data, send) => { }); } - let event_data, event_sub_data, eArray = []; + let event_data, event_sub_data, eArray = [], eArray2 = []; if (hasEventData) { if (_.isNil(event_play_num)) { event_play_num = 0; } event_play_num += 1; @@ -1215,6 +1216,8 @@ export const pcsave: EPR = async (info, data, send) => { let buildingArray = []; res.elements("building_data").forEach((res) => { let building_data = { + map_id, + pos: res.attr().pos, building: res.attr().building, use_tile: res.attr().use_tile, @@ -1226,6 +1229,8 @@ export const pcsave: EPR = async (info, data, send) => { let shopArray = []; res.elements("shop_data").forEach((res) => { let shop_data = { + map_id, + reward_id: res.attr().reward_id, prog: res.attr().prog, } @@ -1241,9 +1246,9 @@ export const pcsave: EPR = async (info, data, send) => { } musicArray.push(music_data); - }); + }); // these are saved but will not used for now // - event_data = { + let map_data = { map_id, play_num: res.attr().play_num, @@ -1258,14 +1263,25 @@ export const pcsave: EPR = async (info, data, send) => { grade_bonus: res.attr().grade_bonus, end_bonus: res.attr().end_bonus, fbonus: res.attr().fbonus, - - buildingArray, - shopArray, - musicArray, }; - eArray.push(event_data); + eArray.push([map_data, buildingArray, shopArray, musicArray]); }); + + if (!_.isNil($(data).element("event_2"))) { + $(data).element("event_2").elements("system_data").forEach((res) => { + let system_data = { + system_id: res.attr().system_id, + + play_num: res.attr().play_num, + unlock_prog: res.attr().unlock_prog, + system_prog: res.attr().system_prog, + gauge: res.attr().gauge, + } + + eArray2.push(system_data); + }); + } } } @@ -1404,7 +1420,7 @@ export const pcsave: EPR = async (info, data, send) => { let skinData = $(data).elements("skin_equip"); let note_burst, bomb_size, turntable, judge_font, note_skin, note_size, lane_cover, pacemaker_cover, - lift_cover, note_beam, note_beam_size, full_combo_splash; + lift_cover, note_beam, note_beam_size, full_combo_splash, frame; skinData.forEach((res) => { if (parseInt(res.attr().skin_id) == 1) { note_burst = parseInt(res.attr().skin_no); } @@ -1420,6 +1436,7 @@ export const pcsave: EPR = async (info, data, send) => { else if (parseInt(res.attr().skin_id) == 16) { note_beam = parseInt(res.attr().skin_no); } else if (parseInt(res.attr().skin_id) == 17) { note_beam_size = parseInt(res.attr().skin_no); } else if (parseInt(res.attr().skin_id) == 18) { full_combo_splash = parseInt(res.attr().skin_no); } + else if (parseInt(res.attr().skin_id) == 19) { frame = parseInt(res.attr().skin_no); } }); await DB.Upsert( @@ -1442,6 +1459,7 @@ export const pcsave: EPR = async (info, data, send) => { note_beam, note_beam_size, full_combo_splash, + frame, } }); } @@ -2568,13 +2586,90 @@ export const pcsave: EPR = async (info, data, send) => { }); eArray.forEach((res) => { + // map_data // DB.Upsert(refid, { collection: "event_1", version: version, - map_id: res.map_id, + event_data: "myepo_map", + map_id: res[0].map_id, }, { - $set: res, + $set: res[0], + }); + + // building_data // + res[1].forEach((res) => { + DB.Upsert(refid, { + collection: "event_1_sub", + version: version, + event_data: "myepo_building", + map_id: res.map_id, + pos: res.pos, + }, + { + $set: res, + }); + }); + + // shop_data // + res[2].forEach((res) => { + DB.Upsert(refid, { + collection: "event_1_sub", + version: version, + event_data: "myepo_shop", + map_id: res.map_id, + reward_id: res.reward_id, + }, + { + $set: res, + }); + }); + + // music // + res[3].forEach((res) => { + DB.Upsert(refid, { + collection: "event_1_sub", + version: version, + event_data: "myepo_music", + }, + { + $set: res, + }); + }); + }); + } + + // event_2 // + if (!_.isNil($(data).element("event_2"))) { + // pack_id, pack_flg, play_pack - UNK // + // erosion_play_num, erosion5_clear12_num aren't being sent // + await DB.Upsert(refid, + { + collection: "event_1", + version: version, + event_data: "epores", + }, + { + $set: { + event_play_num: $(data).attr("event_2").event_play_num, + after_play_num: $(data).attr("event_2").after_play_num, + last_select_system_id: $(data).attr("event_2").last_select_system_id, + gate_key: $(data).attr("event_2").gate_key, + after_gauge: $(data).attr("event_2").after_gauge, + last_select_erosion_level: $(data).attr("event_2").last_select_erosion_level, + } + } + ); + + eArray2.forEach((res) => { + DB.Upsert(refid, { + collection: "event_1_sub", + version: version, + event_data: "epores_system", + system_id: res.system_id, + }, + { + $set: res, }); }); } @@ -2586,11 +2681,11 @@ export const pcsave: EPR = async (info, data, send) => { export const pcvisit: EPR = async (info, data, send) => { send.object(K.ATTR({ aflg: "1", - anum: "1", + anum: "10", pflg: "1", - pnum: "1", + pnum: "10", sflg: "1", - snum: "1", + snum: "10", })); }; diff --git a/handlers/webui.ts b/handlers/webui.ts index 580bce4..151795a 100644 --- a/handlers/webui.ts +++ b/handlers/webui.ts @@ -22,6 +22,7 @@ import { premium_bg_list, premiumbg_bright_list, } from "../data/customlist"; +import { score } from "../models/score"; export const updateProfileSettings = async (data: { // All of data sent as string @@ -56,6 +57,7 @@ export const updateProfileSettings = async (data: { bomb_size?: string; disable_hcn_color?: string; first_note_preview?: string; + disable_basicoption?: string; premium_skin?: string; premium_bg?: string; @@ -167,6 +169,7 @@ export const updateProfileSettings = async (data: { update.disable_musicpreview = Number(stb(data.disable_musicpreview)) update.vefx_lock = Number(stb(data.vefx_lock)) update.disable_hcn_color = Number(stb(data.disable_hcn_color)) + update.disable_basicoption = stb(data.disable_basicoption) // Numeric Field if (data.skin_bgm_flg && data.skin_bgm_flg.length > 0) { @@ -283,7 +286,7 @@ export const updateProfileSettings = async (data: { { collection: 'settings' }, { $set: update } ); -}; +} export const updateRivalSettings = async (data: { // All of data sent as string @@ -537,7 +540,23 @@ export const updateRivalSettings = async (data: { } ) } -}; +} + +export const exportScoreData = async (data: { refid: string; }, send: WebUISend) => { + const score = await DB.Find(data.refid, { + collection: "score" + }); + + let result = { + version: 1, + count: score.length, + data: { + ...score, + }, + } + + send.json(result); +} function stb(s: string | null): boolean { if (_.isNil(s)) return false; diff --git a/index.ts b/index.ts index 6db5ace..3540361 100644 --- a/index.ts +++ b/index.ts @@ -25,7 +25,7 @@ import { import { systeminfo } from "./handlers/IIDXgamesystem"; import { graderaised } from "./handlers/IIDXgrade"; import { ShopRanking_list } from "./data/settingslist"; -import { updateProfileSettings, updateRivalSettings } from "./handlers/webui"; +import { exportScoreData, updateProfileSettings, updateRivalSettings } from "./handlers/webui"; export function register() { if (CORE_VERSION_MAJOR <= 1 && CORE_VERSION_MINOR < 31) { @@ -97,6 +97,7 @@ export function register() { R.WebUIEvent("updateIIDXProfileSettings", updateProfileSettings); R.WebUIEvent("updateIIDXRivalSettings", updateRivalSettings); + R.WebUIEvent("exportScoreData", exportScoreData); R.GameCode("LDJ"); R.GameCode("TDJ"); // This is not used in [TDJ mode] but has been added just in case. // @@ -135,6 +136,10 @@ export function register() { MultiRoute("pc.consumeLaneGachaTicket", true); MultiRoute("pc.drawLaneGacha", true); MultiRoute("pc.getLaneGachaTicket", pcgetlanegacha); + MultiRoute("pc.getCompeInfo", true) + MultiRoute("pc.compeOrganize", true); + MultiRoute("pc.compeEntry", true); + MultiRoute("pc.compeSearch", true); //music MultiRoute("music.getrank", musicgetrank); diff --git a/models/settings.ts b/models/settings.ts index 2468e3a..95c2798 100644 --- a/models/settings.ts +++ b/models/settings.ts @@ -26,6 +26,7 @@ export interface settings { classic_hispeed: boolean; hide_iidxid: boolean; rival_played: boolean; + disable_basicoption: boolean; disable_musicpreview: number; vefx_lock: number; effect: number; @@ -79,6 +80,7 @@ export const settings_data = { classic_hispeed: false, rival_played: true, hide_iidxid: false, + disable_basicoption: false, disable_musicpreview: 0, vefx_lock: 0, effect: 0, diff --git a/pug/31get.pug b/pug/31get.pug index 40ac5eb..5635ae0 100644 --- a/pug/31get.pug +++ b/pug/31get.pug @@ -45,7 +45,7 @@ IIDX31pc(status="0" qproback=settings.qpro_back) selected_course(__type="s32" __count="3") #{ed.selected_course[0]} #{ed.selected_course[1]} #{ed.selected_course[2]} max_past(__type="s32" __count="3") #{ed.max_past[0]} #{ed.max_past[1]} #{ed.max_past[2]} max_selected_course(__type="s32" __count="3") #{ed.max_selected_course[0]} #{ed.max_selected_course[1]} #{ed.max_selected_course[2]} - skin(__type="s32" __count="20") #{appendsetting} #{settings.note_burst} #{settings.bomb_size} #{settings.turntable} #{settings.judge_font} #{settings.note_skin} #{settings.note_size} #{settings.disable_musicpreview} #{settings.vefx_lock} #{settings.effect} #{settings.menu_music} #{settings.disable_hcn_color} #{settings.first_note_preview} #{settings.lane_cover} #{settings.pacemaker_cover} #{settings.lift_cover} #{settings.note_beam} #{settings.note_beam_size} #{settings.full_combo_splash} 0 + skin(__type="s32" __count="20") #{appendsetting} #{settings.note_burst} #{settings.bomb_size} #{settings.turntable} #{settings.judge_font} #{settings.note_skin} #{settings.note_size} #{settings.disable_musicpreview} #{settings.vefx_lock} #{settings.effect} #{settings.menu_music} #{settings.disable_hcn_color} #{settings.first_note_preview} #{settings.lane_cover} #{settings.pacemaker_cover} #{settings.lift_cover} #{settings.note_beam} #{settings.note_beam_size} #{settings.full_combo_splash} #{settings.frame} tdjskin(__type="s16" __count="4") #{settings.premium_skin} #{settings.premium_bg} 0 0 qprodata(__type="u32" __count="6") #{settings.qpro_head} #{settings.qpro_hair} #{settings.qpro_face} #{settings.qpro_hand} #{settings.qpro_body} rlist @@ -86,6 +86,10 @@ IIDX31pc(status="0" qproback=settings.qpro_back) building_data(map_id=evt2.map_id pos=evt2.pos building=evt2.building use_tile=evt2.use_tile) - for (let evt3 of evtArray3) shop_data(map_id=evt3.map_id reward_id=evt3.reward_id prog=evt3.prog) + if epores != null + event_2(event_play_num=epores.event_play_num after_play_num=epores.after_play_num last_select_system_id=epores.last_select_system_id gate_key=epores.gate_key after_gauge=epores.after_gauge last_select_erosion_level=epores.last_select_erosion_level pack="-1" erosion_play_num="10" erosion5_clear12_num="10") + - for (let data of epores_data) + system_data(system_id=data.system_id play_num=data.play_num unlock_prog=data.unlock_prog system_prog=data.system_prog gauge=data.gauge) ultimate_mobile_link(music_list="-1") link_flag valkyrie_linkage(music_list_1="-1" music_list_2="-1" music_list_3="-1") @@ -103,6 +107,7 @@ IIDX31pc(status="0" qproback=settings.qpro_back) flg2(__type="s64" __count="3") -1 -1 -1 world_tourism_setting booster(__type="bool") 1 + bpl_s4_music_unlock badge badge_data(category_id="0" badge_flg_id="0" badge_flg="0") badge_equip(category_id="0" badge_flg="0" badge_flg_id="0" index="0" slot="0") diff --git a/pug/31systeminfo.pug b/pug/31systeminfo.pug index 2342848..5565ee5 100644 --- a/pug/31systeminfo.pug +++ b/pug/31systeminfo.pug @@ -885,8 +885,9 @@ IIDX31gameSystem(status="0") high_music_difficult(__type="s32") 12 is_leggendaria(__type="bool") 1 CommonBossPhase(val=boss) - Event1Phase(val=event_1) - Event1Value(val=event_1_internal) + Event1Phase(val=event_1_internal) + Event1Value(val=event_1) + Event2Phase(val=event_1_internal) ExtraBossEventPhase(val=extra_boss) isNewSongAnother12OpenFlg(val="1") isKiwamiOpenFlg(val="1") diff --git a/util.ts b/util.ts index 1b90816..4727894 100644 --- a/util.ts +++ b/util.ts @@ -72,6 +72,7 @@ export function AppendSettingConverter( ch: boolean, rp: boolean, hi: boolean, + dbo: boolean, ) { const result = Number(sf) << 0 | @@ -86,7 +87,8 @@ export function AppendSettingConverter( Number(dg) << 9 | Number(ch) << 10 | Number(rp) << 11 | - Number(hi) << 12; + Number(hi) << 12 | + Number(dbo) << 14; return result; } diff --git a/webui/profile_export.pug b/webui/profile_export.pug new file mode 100644 index 0000000..4e16ee1 --- /dev/null +++ b/webui/profile_export.pug @@ -0,0 +1,15 @@ +div + .card + .card-header + p.card-header-title + span.icon + i.mdi.mdi-account-edit + | Data Export + .card-content + form(method="post" action="/emit/exportScoreData") + .field + input(type="text" name="refid", value=refid readonly hidden) + button.button.is-primary(type="submit") + span.icon + i.mdi.mdi-check + span Score Export diff --git a/webui/profile_settings.pug b/webui/profile_settings.pug index 71104f8..cbe370e 100644 --- a/webui/profile_settings.pug +++ b/webui/profile_settings.pug @@ -7,6 +7,13 @@ - const frame_list = [ "デフォルト", + "BPLS4 APINA VRAMeS", + "BPLS4 GiGO", + "BPLS4 GAME PANIC", + "BPLS4 SILK HAT", + "BPLS4 TAITO STATION Tradz", + "BPLS4 ROUND1", + "BPLS4 レジャーランド", ]; const menumusic_list = [ @@ -789,7 +796,11 @@ div .field label.label Hide IIDXID .control - input(type="checkbox" name="hide_iidxid", checked=setting.hide_iidxid) + input(type="checkbox" name="hide_iidxid", checked=setting.hide_iidxid) + .field + label.label Disable Beginner Option + .control + input(type="checkbox" name="disable_basicoption", checked=Boolean(setting.disable_basicoption)) .field label.label VEFX Lock .control