diff --git a/iidx@asphyxia/handlers/grade.ts b/iidx@asphyxia/handlers/grade.ts index bc81a1f..f5716f8 100644 --- a/iidx@asphyxia/handlers/grade.ts +++ b/iidx@asphyxia/handlers/grade.ts @@ -92,8 +92,7 @@ export const graderaised: EPR = async (info, data, send) => { return send.object( K.ATTR({ - status: "0", - pnum: "1", + pnum: "1", // This isn't visible to user and seems leftover // }) ); } @@ -164,7 +163,6 @@ export const graderaised: EPR = async (info, data, send) => { return send.object( K.ATTR({ - status: "0", pnum: String(gradeUser.length), }) ); diff --git a/iidx@asphyxia/handlers/music.ts b/iidx@asphyxia/handlers/music.ts index 0375507..9262645 100644 --- a/iidx@asphyxia/handlers/music.ts +++ b/iidx@asphyxia/handlers/music.ts @@ -33,6 +33,7 @@ export const musicgetrank: EPR = async (info, data, send) => { music_data.forEach((res: score) => { temp_mid = NewMidToOldMid(res.mid); let verMid = OldMidToVerMid(temp_mid); + let rank_id = -1; // TODO:: determine whether use rid,dj_level from music.reg or make a database that has max exscore of all songs for rid // if (verMid[0] > version) return; @@ -41,15 +42,22 @@ export const musicgetrank: EPR = async (info, data, send) => { result.r.push( K.ITEM("str", NumArrayToString( [7, 4, 13, 3, 3], - [verMid[1], a, res.esArray[indices[a]], -1, res.cArray[indices[a]]] // 4th element is rid (rank_id) // + [verMid[1], a, res.esArray[indices[a]], rank_id, res.cArray[indices[a]]] // 4th element is rid (rank_id) // ), { v: String(verMid[0]) } ) ); } + + // BEGINNER // + if (res.cArray[0] == 0) return; + result.r.push( + K.ITEM("str", NumArrayToString( + [12, 6], + [temp_mid, res.cArray[0]] + ), { v: String("-1") }) + ); }); - // rival data seems to be retrieve from getralive // - - // tutorial // + // TUTORIAL // const tutorial = await DB.Find(refid, { collection: "tutorial", version: version @@ -465,7 +473,7 @@ export const musicreg: EPR = async (info, data, send) => { if (!_.isNil($(data).attr().rid)) rid = parseInt($(data).attr().rid); else if (!_.isNil($(data).attr().dj_level)) rid = parseInt($(data).attr().dj_level); - console.log(rid); + if (rid > -1) console.log(`[music.reg] rank_id : ${rid}`); if (version == 15) ghost = Buffer.from($(data).str("ghost"), "hex").toString("base64"); else ghost = $(data).buffer("ghost").toString("base64"); diff --git a/iidx@asphyxia/handlers/pc.ts b/iidx@asphyxia/handlers/pc.ts index dade5ed..e825258 100644 --- a/iidx@asphyxia/handlers/pc.ts +++ b/iidx@asphyxia/handlers/pc.ts @@ -403,7 +403,7 @@ export const pcget: EPR = async (info, data, send) => { custom.rival_played_folder, custom.hide_iidxid, ); - let dArray = [], eArray = [], rArray = [], mArray = [], bArray = [], gArray = []; + let dArray = [], eArray = [], rArray = [], mArray = [], bArray = []; grade.forEach((res: grade) => { dArray.push([res.style, res.gradeId, res.maxStage, res.archive]); @@ -459,14 +459,22 @@ export const pcget: EPR = async (info, data, send) => { wArray.sort((a, b) => a.tour_id - b.tour_id); } - let event, gradeStr, exStr, skinStr; + let event, gradeStr = "", exStr = "", skinStr = ""; if (version == 15) { - dArray.forEach((res: grade) => { - gArray.concat([res.gradeId, res.maxStage, res.style, res.archive]); + dArray.forEach((res) => { + gradeStr += NumArrayToString([6, 3, 2, 7], [res[1], res[2], res[0], res[3]]); }); - gradeStr = NumArrayToString([6, 3, 2, 7], gArray); - exStr = ""; // TODO:: // - skinStr = NumArrayToString([12], [custom.frame, custom.turntable, custom.note_burst, custom.menu_music, appendsettings, custom.lane_cover, 0, custom.category_vox]); + + expert.sort((a: expert, b: expert) => a.coid - b.coid); + expert.forEach((res) => { + for (let a = 0; a < 6; a++) { + exStr += NumArrayToString([6, 3, 3], [res.coid, a, res.cArray[a]]); + exStr += NumArrayToString([18], [res.pgArray[a]]); + exStr += NumArrayToString([18], [res.gArray[a]]); + } + }); + + skinStr += NumArrayToString([12], [custom.frame, custom.turntable, custom.note_burst, custom.menu_music, appendsettings, custom.lane_cover, 0, custom.category_vox]); return send.pugFile("pug/HDD/pcget.pug", { profile, diff --git a/iidx@asphyxia/handlers/ranking.ts b/iidx@asphyxia/handlers/ranking.ts index ceb6265..b97bc5b 100644 --- a/iidx@asphyxia/handlers/ranking.ts +++ b/iidx@asphyxia/handlers/ranking.ts @@ -106,17 +106,18 @@ export const rankingentry: EPR = async (info, data, send) => { } ); - let expertUser = await DB.Find(null, { - collection: "expert", + let expertUser = await DB.Find(null, { + collection: "ranking", version: version, coid: coid, clid: clid, - maxStage: 5, }); + expertUser.sort((a: ranking, b: ranking) => b.exscore - a.exscore); + let rankPos = expertUser.findIndex((a: ranking) => a.name == name); return send.object(K.ATTR({ - anum: String(expertUser.length), - jun: "1", + anum: String(expertUser.length), + jun: String(rankPos + 1), })); }; diff --git a/iidx@asphyxia/handlers/shop.ts b/iidx@asphyxia/handlers/shop.ts index d06be13..76cd9ce 100644 --- a/iidx@asphyxia/handlers/shop.ts +++ b/iidx@asphyxia/handlers/shop.ts @@ -17,7 +17,6 @@ export const shopgetname: EPR = async (info, data, send) => { return send.object( K.ATTR({ - status: "0", opname: "CORE", pid: "57", cls_opt: "0", @@ -29,7 +28,6 @@ export const shopgetname: EPR = async (info, data, send) => { return send.object( K.ATTR({ - status: "0", opname: shop_data.opname, pid: String(shop_data.pid), cls_opt: String(shop_data.cls_opt), diff --git a/iidx@asphyxia/models/grade.ts b/iidx@asphyxia/models/grade.ts index fa04537..442de49 100644 --- a/iidx@asphyxia/models/grade.ts +++ b/iidx@asphyxia/models/grade.ts @@ -6,5 +6,5 @@ export interface grade { gradeId: number; maxStage: number; - archive: number; + archive: number; // typo: achieve // }