From 4a0e97106ad1c3f28c7f45ceb8312c15b6f9603d Mon Sep 17 00:00:00 2001 From: duel0213 Date: Sat, 6 Apr 2024 20:48:42 +0900 Subject: [PATCH] IIDX: Changed music.appoint response to comply with old games (~ DJ TROOPERS) --- iidx@asphyxia/README.md | 1 + iidx@asphyxia/handlers/music.ts | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/iidx@asphyxia/README.md b/iidx@asphyxia/README.md index 423a6b1..1f91114 100644 --- a/iidx@asphyxia/README.md +++ b/iidx@asphyxia/README.md @@ -133,3 +133,4 @@ Changelogs **v0.1.15** - Added Initial support for GOLD - Fixed where plugin may fail to register due to missing types in dev mode + - Fixed where pacemaker isn't working as intended due to malformed ghost data on music.appoint response (~ DJ TROOPERS) diff --git a/iidx@asphyxia/handlers/music.ts b/iidx@asphyxia/handlers/music.ts index 39a3979..c584776 100644 --- a/iidx@asphyxia/handlers/music.ts +++ b/iidx@asphyxia/handlers/music.ts @@ -1,4 +1,4 @@ -import { IDtoRef, Base64toNumArray, GetVersion, OldMidToNewMid, NewMidToOldMid, ReftoProfile, ReftoPcdata, ClidToPlaySide, ReftoQPRO, NumArrayToString, OldMidToVerMid, HextoBase64, NumArraytoBase64 } from "../util"; +import { IDtoRef, Base64toNumArray, GetVersion, OldMidToNewMid, NewMidToOldMid, ReftoProfile, ReftoPcdata, ClidToPlaySide, ReftoQPRO, NumArrayToString, OldMidToVerMid, HextoBase64, NumArraytoBase64, NumArraytoHex } from "../util"; import { score, score_top } from "../models/score"; import { profile } from "../models/profile"; import { shop_data } from "../models/shop"; @@ -319,7 +319,8 @@ export const musicappoint: EPR = async (info, data, send) => { } } - mydata = K.ITEM("bin", Base64toNumArray(music_data[clid])); + if (version < 16) mydata = K.ITEM("str", NumArraytoHex(Base64toNumArray(music_data[clid]))); + else mydata = K.ITEM("bin", Base64toNumArray(music_data[clid])); } /*** ctype @@ -354,12 +355,23 @@ export const musicappoint: EPR = async (info, data, send) => { }); if (_.isNaN(other_pcdata) || _.isNil(other_musicdata)) break; - sdata = K.ITEM("bin", Base64toNumArray(other_musicdata[clid]), { - score: String(other_musicdata.esArray[clid]), - pid: String(other_profile[1]), - name: String(other_profile[0]), - riidxid: String(other_profile[2]) - }); + if (version < 16) { + sdata = K.ITEM("str", NumArraytoHex(Base64toNumArray(other_musicdata[clid])), { + score: String(other_musicdata.esArray[clid]), + pid: String(other_profile[1]), + name: String(other_profile[0]), + riidxid: String(other_profile[2]) + }); + } + else { + sdata = K.ITEM("bin", Base64toNumArray(other_musicdata[clid]), { + score: String(other_musicdata.esArray[clid]), + pid: String(other_profile[1]), + name: String(other_profile[0]), + riidxid: String(other_profile[2]) + }); + } + break; default: