This commit is contained in:
vvo
2024-10-27 15:34:29 +08:00
parent 20ba236f5b
commit bb82ec9034
12 changed files with 460 additions and 333 deletions
+7 -10
View File
@@ -103,12 +103,11 @@ export const common: EPR = async (info, data, send) => {
// if song is released during exceed gear
if(songData.info.version['#text'] === '6') {
// Licensed songs released in Exceed Gear needs limited=3 to appear
if(LICENSED_SONGS6.includes(i.toString())) {
limitedNo += 1;
}
else if(VALKYRIE_SONGS.includes(i.toString()) && info.model.split(":")[2].match(/^(G|H)$/g) == null){
limitedNo -= 1;
}
if(LICENSED_SONGS6.includes(i.toString())) limitedNo += 1;
else if(VALKYRIE_SONGS.includes(i.toString()) && info.model.split(":")[2].match(/^(G|H)$/g) == null) limitedNo -= 1;
if(i === 2034) limitedNo = 2;
for(let j = 0; j < 5; j++) {
songs.push({
music_id: K.ITEM('s32', i),
@@ -231,7 +230,7 @@ export const common: EPR = async (info, data, send) => {
'id': stmpEvntInfo['info']['id'],
'params': [
9,
(stmpEvntInfo['info']['textstampval'] !== undefined) ? stmpEvntInfo['info']['textstampval'] : 0,
((stmpEvntInfo['info']['textstampval'] !== undefined) ? stmpEvntInfo['info']['textstampval'] : 0),
0,
0,
0,
@@ -383,11 +382,8 @@ export const common: EPR = async (info, data, send) => {
],
});
}
}
console.log("Sending common objects");
let arena_szn = U.GetConfig('arena_szn')
let arena_catalog_items = []
@@ -439,6 +435,7 @@ export const common: EPR = async (info, data, send) => {
}
}
console.log("Sending common objects");
send.object(
{
valgene: {
+21
View File
@@ -0,0 +1,21 @@
import { COURSES6 } from "../data/exg"
export async function dataUpdate() {
await updateSkillCourseIds()
}
async function updateSkillCourseIds() {
let skillData
let course = await DB.Find(null, {collection: 'course'})
course.forEach(async c => {
skillData = COURSES6.find(sd => sd.id === c['sid'])
if(skillData['courses'].findIndex(cd => cd.id === c['cid']) === -1) {
console.log("(" + c['__refid'] + ") updating cid " + c['cid'] + " -> " + parseInt(c['sid'].toString() + c['cid'].toString()))
await DB.Upsert(c['__refid'], {collection: 'course', sid: c['sid'], cid: c['cid']}, {
$set: {
cid: parseInt(c['sid'].toString() + c['cid'].toString())
}
})
}
})
}
+8 -2
View File
@@ -520,12 +520,16 @@ export const save: EPR = async (info, data, send) => {
const sid = course.number('ssnid');
const cid = course.number('crsid');
const stype = course.number('st');
const kacid = course.str('kac_id');
if (!(_.isNil(sid) || _.isNil(cid))){
await DB.Upsert<CourseRecord>(
refid,
{ collection: 'course', sid, cid, stype, version },
{
$set: {
kacId: kacid
},
$max: {
score: course.number('sc', 0),
exscore: course.number('ex', 0),
@@ -635,7 +639,7 @@ export const load: EPR = async (info, data, send) => {
console.log("DataID: " + refid);
if (version == 0) return send.deny();
const profile = await DB.FindOne<Profile>(refid, {
let profile = await DB.FindOne<Profile>(refid, {
collection: 'profile',
});
@@ -751,8 +755,9 @@ export const load: EPR = async (info, data, send) => {
const stampRC = profile.stampRC ? profile.stampRC : 0;
const stampRD = profile.stampRD ? profile.stampRD : 0;
const sysBG = profile.sysBG ? profile.sysBG : 0;
const bplSupport = profile.bplSupport ? profile.bplSupport : 0;
const creatorItem = profile.creatorItem ? profile.creatorItem : 0;
const bplPro = (profile.bplSupport > 10) ? true : false
profile.bplSupport = profile.bplSupport ? profile.bplSupport % 10 : 0;
const customize = [];
customize.push(bgm, subbg, nemsys, stampA, stampB, stampC, stampD, stampRA, stampRB, stampRC, stampRD, sysBG);
@@ -796,6 +801,7 @@ export const load: EPR = async (info, data, send) => {
arena,
valgeneTicket,
creatorItem,
bplPro,
...profile,
});
};
+2 -1
View File
@@ -17,6 +17,7 @@ export const updateProfile = async (data: {
appeal?: string;
akaname?: string;
bplSupport?: string;
bplPro?: boolean;
nemsys?: string;
bgm?: string;
subbg?: string;
@@ -61,7 +62,7 @@ export const updateProfile = async (data: {
}
if (data.bplSupport && data.bplSupport.length > 0) {
const validBplSupport = parseInt(data.bplSupport);
const validBplSupport = data.bplPro ? parseInt(data.bplSupport) + 10 : parseInt(data.bplSupport);
if (!_.isNaN(validBplSupport)) update.bplSupport = validBplSupport;
}