From 6eba5cd721bf0e48b6f097094556b84c52736f51 Mon Sep 17 00:00:00 2001 From: vvo <> Date: Fri, 6 Jan 2023 20:08:34 +0800 Subject: [PATCH] bpl w5 event --- sdvx@asphyxia/data/exg.ts | 6 ++ sdvx@asphyxia/handlers/common.ts | 30 ++-------- sdvx@asphyxia/handlers/profiles.ts | 66 +++++++++++----------- sdvx@asphyxia/handlers/webui.ts | 10 ++-- sdvx@asphyxia/webui/asset/json/events.json | 35 ++++++------ 5 files changed, 67 insertions(+), 80 deletions(-) diff --git a/sdvx@asphyxia/data/exg.ts b/sdvx@asphyxia/data/exg.ts index 0fcc77e..dee7f51 100644 --- a/sdvx@asphyxia/data/exg.ts +++ b/sdvx@asphyxia/data/exg.ts @@ -123,6 +123,9 @@ export const EVENT_SONGS6 = { ], "bpl2022_4": [ '1946', '1958' + ], + "bpl2022_5": [ + '1957', '1955' ] } @@ -172,6 +175,9 @@ export const RESTRICTED_SONGS6 = { ], "bpl2022_4": [ '1946', '1958' + ], + "bpl2022_5": [ + '1957', '1955' ] } diff --git a/sdvx@asphyxia/handlers/common.ts b/sdvx@asphyxia/handlers/common.ts index 417d767..9881bcf 100644 --- a/sdvx@asphyxia/handlers/common.ts +++ b/sdvx@asphyxia/handlers/common.ts @@ -440,32 +440,10 @@ export const log: EPR = async (info, data, send) => { } export const unhandledt: EPR = async (info, data, send) => { + console.log("") console.log("Unhandled: " + info.method + " | " + info.model + " | " + info.module) - console.log("Info:") - for (let key in info) { - type ObjectKey = keyof typeof info; - const myVar = key as ObjectKey; - if (typeof info[key] === 'object') { - console.log(key + ' - ' + JSON.stringify(info[key])); - } else console.log(key + ' - ' + info[key]); - } + console.log(JSON.stringify(info)) + console.log(JSON.stringify(data)) console.log("") - console.log("Data:") - for (let key in data) { - type ObjectKey = keyof typeof data; - const myVar = key as ObjectKey; - if (typeof data[key] === 'object') { - console.log(key + ' - ' + JSON.stringify(data[key])); - } else console.log(key + ' - ' + data[key]); - } - console.log("") - console.log("Send:") - for (let key in send) { - type ObjectKey = keyof typeof send; - const myVar = key as ObjectKey; - if (typeof send[key] === 'object') { - console.log(key + ' - ' + JSON.stringify(send[key])); - } else console.log(key + ' - ' + send[key]); - } - console.log('') + return send.success() } diff --git a/sdvx@asphyxia/handlers/profiles.ts b/sdvx@asphyxia/handlers/profiles.ts index 2ab5d88..09dc6a5 100644 --- a/sdvx@asphyxia/handlers/profiles.ts +++ b/sdvx@asphyxia/handlers/profiles.ts @@ -673,7 +673,7 @@ export const load: EPR = async (info, data, send) => { ...profile }); } - const bgm = profile.bgm ? profile.bgm : 0; + // const bgm = profile.bgm ? profile.bgm : 0; const subbg = profile.subbg ? profile.subbg : 0; const nemsys = profile.nemsys ? profile.nemsys : 0; const stampA = profile.stampA ? profile.stampA : 0; @@ -704,38 +704,16 @@ export const load: EPR = async (info, data, send) => { tempItem = U.GetConfig('unlock_all_appeal_cards') ? unlockAppealCards(items) : items; tempItem = removeStampItems(tempItem) - let eventData = JSON.parse(await IO.ReadFile('webui/asset/json/events.json')) - let eventConfig = JSON.parse(await IO.ReadFile('webui/asset/config/events.json')) let presents = [] - for(const eventIter in eventData['events']) { - if(!eventData['events'][eventIter]['in_game_event']) { - if(typeof eventConfig[eventData['events'][eventIter]['id']]['toggle'] === "boolean") { - if(eventConfig[eventData['events'][eventIter]['id']]['toggle']) { - for(const itemIter in EVENT_SONGS6[eventData['events'][eventIter]['id']]) { - let itemId = parseInt(EVENT_SONGS6[eventData['events'][eventIter]['id']][itemIter]) - if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { - await DB.Upsert( - refid, - {collection: 'item', type: 0, id: itemId}, - {$set: { param: 23 }} - ) - - presents.push({ - id: itemId, - type: 0, - param: 23 - }) - - tempItem.push({ collection: 'item', type: 0, id: itemId, param: 23 }) - } - } - } - } else{ - // eventConfig[eventData['events'][eventIter]['id']]['toggle'] - for(const toggleKeys in Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])) { - if(eventConfig[eventData['events'][eventIter]['id']]['toggle'][Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { - for(const itemIter in EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { - let itemId = parseInt(EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]][itemIter]) + if(IO.Exists('webui/asset/config/events.json')) { + let eventData = JSON.parse(await IO.ReadFile('webui/asset/json/events.json')) + let eventConfig = JSON.parse(await IO.ReadFile('webui/asset/config/events.json')) + for(const eventIter in eventData['events']) { + if(!eventData['events'][eventIter]['in_game_event']) { + if(typeof eventConfig[eventData['events'][eventIter]['id']]['toggle'] === "boolean") { + if(eventConfig[eventData['events'][eventIter]['id']]['toggle']) { + for(const itemIter in EVENT_SONGS6[eventData['events'][eventIter]['id']]) { + let itemId = parseInt(EVENT_SONGS6[eventData['events'][eventIter]['id']][itemIter]) if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { await DB.Upsert( refid, @@ -753,6 +731,30 @@ export const load: EPR = async (info, data, send) => { } } } + } else{ + // eventConfig[eventData['events'][eventIter]['id']]['toggle'] + for(const toggleKeys in Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])) { + if(eventConfig[eventData['events'][eventIter]['id']]['toggle'][Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { + for(const itemIter in EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]]) { + let itemId = parseInt(EVENT_SONGS6[Object.keys(eventConfig[eventData['events'][eventIter]['id']]['toggle'])[toggleKeys]][itemIter]) + if(await DB.Count(refid, {collection:'item', id: itemId}) === 0) { + await DB.Upsert( + refid, + {collection: 'item', type: 0, id: itemId}, + {$set: { param: 23 }} + ) + + presents.push({ + id: itemId, + type: 0, + param: 23 + }) + + tempItem.push({ collection: 'item', type: 0, id: itemId, param: 23 }) + } + } + } + } } } } diff --git a/sdvx@asphyxia/handlers/webui.ts b/sdvx@asphyxia/handlers/webui.ts index f08ef84..1319c96 100644 --- a/sdvx@asphyxia/handlers/webui.ts +++ b/sdvx@asphyxia/handlers/webui.ts @@ -263,9 +263,9 @@ export const copyResourcesFromGame = async (data: {}) => { 'music': mdbJsonFix } }; - IO.WriteFile('webui/asset/json/music_db.json', JSON.stringify(mdbJsonFixFinal)); + IO.WriteFile('webui/asset/json/music_db.json', JSON.stringify(mdbJsonFixFinal, null, 4)); if(!IO.Exists('webui/asset/json/music_db_' + version + '.json')){ - IO.WriteFile('webui/asset/json/music_db_' + version + '.json', JSON.stringify(mdbJsonFixFinal)); + IO.WriteFile('webui/asset/json/music_db_' + version + '.json', JSON.stringify(mdbJsonFixFinal, null, 4)); } } else { @@ -438,8 +438,8 @@ export const copyResourcesFromGame = async (data: {}) => { runErrors.push('[chat stamp] Error reading chat stamp xml file. Check your "Exceed Gear Data Directory" config.') } - await IO.WriteFile('webui/asset/json/data.json', JSON.stringify(resourceJsonData)) - await IO.WriteFile('webui/asset/json/appeal.json', JSON.stringify(apCardJsonData)) + await IO.WriteFile('webui/asset/json/data.json', JSON.stringify(resourceJsonData, null, 4)) + await IO.WriteFile('webui/asset/json/appeal.json', JSON.stringify(apCardJsonData, null, 4)) await IO.WriteFile('webui/asset/logs/copyResourcesFromGame.json', JSON.stringify({ akaname: newAkanames, nemsys: newNemsysData, @@ -452,7 +452,7 @@ export const copyResourcesFromGame = async (data: {}) => { jsonSongs: newJsonSongs.sort((a, b) => a[0] - b[0]), xcdSongs: newXCDSongs.sort((a, b) => a[0] - b[0]), errors: runErrors - })) + }, null, 4)) } export const preGeneRoll = async (data: { diff --git a/sdvx@asphyxia/webui/asset/json/events.json b/sdvx@asphyxia/webui/asset/json/events.json index 0668347..53e9bf0 100644 --- a/sdvx@asphyxia/webui/asset/json/events.json +++ b/sdvx@asphyxia/webui/asset/json/events.json @@ -5,8 +5,8 @@ "in_game_event": false, "name": "X-record", "info": [ - "1st set of songs from X-record; originally unlocked by playing either SOUND VOLTEX on the Valkyrie model, or beatmaniaIIDX on the Lightning model. Enable this option to have them automatically unlocked and saved to your account.", - "2nd set of songs from X-record; originally unlocked by playing either SOUND VOLTEX on the Valkyrie model, or beatmaniaIIDX on the Lightning model. Enable this option to have them automatically unlocked and saved to your account." + "1st set of songs from X-record; originally unlocked by playing either SOUND VOLTEX on the Valkyrie model, or beatmaniaIIDX on the Lightning model.
Enable this option to have them automatically unlocked and saved to your account.", + "2nd set of songs from X-record; originally unlocked by playing either SOUND VOLTEX on the Valkyrie model, or beatmaniaIIDX on the Lightning model.
Enable this option to have them automatically unlocked and saved to your account." ] }, { @@ -14,59 +14,60 @@ "in_game_event": false, "name": "グレイスからの挑戦状!! (GRACE kara no chousenjou!!)", "info": [ - "Enables unlock for the song 'ドゥサンコオデッセイ!!' by cosMo@暴走P upon logging in. This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", - "Enables unlock for the song 'αzalea' by BlackY upon logging in. This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", - "Enables unlock for the song 'BAYONEX' by かめりあ as \"Revenge of Riot\" upon logging in. This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", - "Enables unlock for the song 'Reverenced Flower' by ぺのれり upon logging in. This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", - "Enables unlock for the song '《Re:miniscence》' by かねこちはる upon logging in. This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex." + "Enables unlock for the song 'ドゥサンコオデッセイ!!' by cosMo@暴走P upon logging in.
This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", + "Enables unlock for the song 'αzalea' by BlackY upon logging in.
This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", + "Enables unlock for the song 'BAYONEX' by かめりあ as \"Revenge of Riot\" upon logging in.
This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", + "Enables unlock for the song 'Reverenced Flower' by ぺのれり upon logging in.
This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex.", + "Enables unlock for the song '《Re:miniscence》' by かねこちはる upon logging in.
This song is originally unlocked by having played it first on the コナステ (Konasute) version of Sound Voltex." ] }, { "id": "bpl2021", "in_game_event": false, "name": "BPL応援 楽曲解禁スタンプラリー (BPL ouen gakkyoku kaikin stamp rally)", - "info": "Songs in this event are originally unlocked by accessing the official BEMANI PRO LEAGUE 2021 website and obtaining the stamp by watching VODs of the BPL. Enable this option to have them unlocked and saved to your account." + "info": "Songs in this event are originally unlocked by accessing the official BEMANI PRO LEAGUE 2021 website and obtaining the stamp by watching VODs of the BPL competition.
Enable this option to have them unlocked and saved to your account." }, { "id": "bsb2021", "in_game_event": false, "name": "BEMANI 2021真夏の歌合戦5番勝負 (BEMANI 2021 manatsu no utagassen 5 ban shoubu)", - "info": "This is a cross-BEMANI event. Songs are originally unlocked by playing participating BEMANI games and earn 'Yell' points. Enable this option to have the songs unlocked and saved to your account." + "info": "This is a cross-BEMANI event. Songs are originally unlocked by playing participating BEMANI games and earn 'Yell' points.
Enable this option to have the songs unlocked and saved to your account." }, { "id": "sdvx10thstamp", "in_game_event": true, "name": "SOUND VOLTEX 10th Anniversary", - "info": "Stamp event to unlock 7 songs. Enable this option to enable this stamp event." + "info": "Stamp event to unlock 7 songs.
Enable this option to enable this stamp event." }, { "id": "reflecstamp", "in_game_event": true, "name": "REFLEC BEAT Song Stamp Event", - "info": "Stamp event to unlock 5 songs originally from the REFLEC BEAT game. Enable this option to enable this stamp event." + "info": "Stamp event to unlock 5 songs originally from the REFLEC BEAT game.
Enable this option to enable this stamp event." }, { "id": "gmz2022", "in_game_event": false, "name": "いちかのごちゃまぜMix UP! (Ichika no gochamaze Mix UP! )", - "info": "This is a cross-BEMANI event. Songs include some that are shared from other BEMANI games and some that are mashup/remixes of the shared songs. These are originally unlocked by playing participating BEMANI games and earning points to fill different gauges. Enable this option to have the songs unlocked and saved to your account." + "info": "This is a cross-BEMANI event. Songs include some that are shared from other BEMANI games and some that are mashup/remixes of the shared songs. These are originally unlocked by playing participating BEMANI games and earning points to fill different gauges.

Enable this option to have the songs unlocked and saved to your account." }, { "id": "bpl2022", "in_game_event": false, "name": "BEMANI PRO LEAGUE -SEASON 2-! Original Song", "info": [ - "Enable this option to have songs from the 1st week unlocked on the next login. Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 2nd week unlocked on the next login. Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 3rd week unlocked on the next login. Otherwise, the songs are still unlockable through BLASTER GATE.", - "Enable this option to have songs from the 4th week unlocked on the next login. Otherwise, the songs are still unlockable through BLASTER GATE." + "Enable this option to have songs from the 1st week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", + "Enable this option to have songs from the 2nd week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", + "Enable this option to have songs from the 3rd week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", + "Enable this option to have songs from the 4th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE.", + "Enable this option to have songs from the 5th week unlocked on the next login.
Otherwise, the songs are still unlockable through BLASTER GATE." ] }, { "id": "pcbevent", "in_game_event": true, "name": "PCB Stamp Event", - "info": "Stamp event to earn PCB. Enable this option to enable this stamp event." + "info": "Stamp event to earn PCB.
Enable this option to enable this stamp event." } ] } \ No newline at end of file