IIDX: Added BEGINNER/EXPERT play record support for DJ TROOPERS

This commit is contained in:
duel0213 2024-02-27 11:03:36 +09:00
parent 6244f37687
commit ad074e5380
6 changed files with 36 additions and 23 deletions

View File

@ -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),
})
);

View File

@ -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<tutorial>(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");

View File

@ -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,

View File

@ -106,17 +106,18 @@ export const rankingentry: EPR = async (info, data, send) => {
}
);
let expertUser = await DB.Find<expert>(null, {
collection: "expert",
let expertUser = await DB.Find<ranking>(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),
}));
};

View File

@ -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),

View File

@ -6,5 +6,5 @@ export interface grade {
gradeId: number;
maxStage: number;
archive: number;
archive: number; // typo: achieve //
}