Some fixes for 2023042500+ (#5)
* Increase maximum song number to unlock all songs * Crash fix on random songs starting 2023042500
This commit is contained in:
@@ -71,7 +71,7 @@ export const common: EPR = async (info, data, send) => {
|
||||
}
|
||||
let songs = [];
|
||||
const gameVersion = getVersion(info);
|
||||
let songNum = 2000;
|
||||
let songNum = 3000;
|
||||
if(gameVersion === 2) songNum = 554;
|
||||
if(gameVersion === 3) songNum = 954;
|
||||
if(gameVersion === 4) songNum = 1368;
|
||||
|
||||
@@ -63,6 +63,7 @@ export const hiscore: EPR = async (info, data, send) => {
|
||||
|
||||
export const rival: EPR = async (info, data, send) => {
|
||||
const refid = $(data).str('refid');
|
||||
const version = parseInt(info.model.split(":")[4]);
|
||||
if (!refid) return send.deny();
|
||||
|
||||
const rivals = (
|
||||
@@ -79,7 +80,8 @@ export const rival: EPR = async (info, data, send) => {
|
||||
music: (
|
||||
await DB.Find<MusicRecord>(p.__refid, { collection: 'music' })
|
||||
).map(r => ({
|
||||
param: K.ARRAY('u32', [r.mid, r.type, r.score, r.clear, r.grade]),
|
||||
// Changes were somehow made in the order of the field for the version 2023042500
|
||||
param: K.ARRAY('u32', version < 2023042500 ? [r.mid, r.type, r.score, r.clear, r.grade] : [r.mid, r.type, r.score, r.grade, r.clear]),
|
||||
})),
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user