sdvx: added WIP features - arena save, valgene, common.ts updates, webui features

This commit is contained in:
vvo
2022-09-20 18:23:13 +08:00
parent be4e9ba6fc
commit cd64a4e781
99 changed files with 2517 additions and 439 deletions
+1175 -102
View File
File diff suppressed because it is too large Load Diff
+201 -11
View File
@@ -1,21 +1,39 @@
import { EVENT4, COURSES4, EXTENDS4 } from '../data/hvn'; import { EVENT4, COURSES4, EXTENDS4 } from '../data/hvn';
import { EVENT5, COURSES5, EXTENDS5 } from '../data/vvw'; import { EVENT5, COURSES5, EXTENDS5 } from '../data/vvw';
import { EVENT6, COURSES6, EXTENDS6 } from '../data/exg'; import { EVENT6, COURSES6, EXTENDS6, APRILFOOLSSONGS, XRECORDSONGS,
KONASTESONGS, BEMANI2021EVENTSONGS, BPLSTAMPRALLYSONGS, SDVX10THSTAMPSONGS,
REFLECBEATSTAMPSONGS, VALKYRIEEXCLUSIVESONGS, MISSINGSONGS6, ARENA, VALGENE
} from '../data/exg';
import { COURSE2 } from '../data/inf'; import { COURSE2 } from '../data/inf';
import {getVersion, getRandomIntInclusive} from '../utils'; import {getVersion, getRandomIntInclusive} from '../utils';
function writeLog(log){
if(U.GetConfig('debug_log_toggle')) {
console.log(log);
}
}
export const common: EPR = async (info, data, send) => { export const common: EPR = async (info, data, send) => {
try {
IO.ReadFile('webui\\asset\\json\\music_db.json').then(
function(value) {
let events = []; let events = [];
let courses = []; let courses = [];
let extend = []; let extend = [];
console.log("Calling common function"); let date = new Date();
let currentYMDDate = parseInt([date.getFullYear(), ((date.getMonth() + 1) > 9 ? '' : '0') + (date.getMonth() + 1), (date.getDate() > 9 ? '' : '0') + date.getDate()].join(''));
let currentDate = date.toLocaleDateString()
writeLog("Calling common function");
const version = parseInt(info.model.split(":")[4]); const version = parseInt(info.model.split(":")[4]);
if (version <= 2013052900) { if (version <= 2013052900) {
writeLog('Game: Booth')
return send.pugFile('templates/booth/common.pug'); return send.pugFile('templates/booth/common.pug');
} }
if (version <= 2014112000) { if (version <= 2014112000) {
writeLog('Game: Infinite Infection')
courses = COURSE2; courses = COURSE2;
return send.pugFile('templates/infiniteinfection/common.pug',{ return send.pugFile('templates/infiniteinfection/common.pug',{
courses, courses,
@@ -24,6 +42,7 @@ export const common: EPR = async (info, data, send) => {
switch (info.method) { switch (info.method) {
case 'sv4_common': { case 'sv4_common': {
writeLog('Game: Heavenly Haven')
events = EVENT4; events = EVENT4;
courses = COURSES4; courses = COURSES4;
//extend = EXTENDS4; //extend = EXTENDS4;
@@ -31,6 +50,7 @@ export const common: EPR = async (info, data, send) => {
break; break;
} }
case 'sv5_common': { case 'sv5_common': {
writeLog('Game: Vivid Wave')
events = EVENT5; events = EVENT5;
courses = COURSES5; courses = COURSES5;
//extend = EXTENDS5; //extend = EXTENDS5;
@@ -38,22 +58,32 @@ export const common: EPR = async (info, data, send) => {
break; break;
} }
case 'sv6_common': { case 'sv6_common': {
writeLog('Game: Exceed Gear')
//events = EVENT6; //events = EVENT6;
EVENT6.forEach(val => events.push(val)); EVENT6.forEach(val => events.push(val));
courses = COURSES6; courses = COURSES6;
// IO.ReadFile('webui\\asset\\json\\course_data.json').then(
// function(yesData){
// console.log('yes')
// let courseData = JSON.parse(yesData)
// courses = courseData.courseData.find(data => data.version == 6).info;
// },
// function(noData){
// console.log(noData)
// })
EXTENDS6.forEach(val => extend.push(Object.assign({}, val))); EXTENDS6.forEach(val => extend.push(Object.assign({}, val)));
break; break;
} }
} }
let songs = []; let songs = [];
if (U.GetConfig('unlock_all_songs')) {
console.log("Unlocking songs");
const gameVersion = getVersion(info); const gameVersion = getVersion(info);
let songNum = 2000; let songNum = 2000;
if(gameVersion === 2) songNum = 554; if(gameVersion === 2) songNum = 554;
if(gameVersion === 3) songNum = 954; if(gameVersion === 3) songNum = 954;
if(gameVersion === 4) songNum = 1368; if(gameVersion === 4) songNum = 1368;
if(U.GetConfig('unlock_all_songs')) {
writeLog("Unlocking songs");
for (let i = 1; i < songNum; ++i) { for (let i = 1; i < songNum; ++i) {
for (let j = 0; j < 5; ++j) { for (let j = 0; j < 5; ++j) {
songs.push({ songs.push({
@@ -61,13 +91,54 @@ export const common: EPR = async (info, data, send) => {
music_type: K.ITEM('u8', j), music_type: K.ITEM('u8', j),
limited: K.ITEM('u8', 3), limited: K.ITEM('u8', 3),
}); });
}
}
} else {
let RESTRICT_SONGS = XRECORDSONGS.concat(KONASTESONGS, BEMANI2021EVENTSONGS, BPLSTAMPRALLYSONGS, SDVX10THSTAMPSONGS, REFLECBEATSTAMPSONGS);
let mdb = JSON.parse(value);
let limitedNo = 2;
for (let i = 0; i < songNum; i++) {
var foundSongIndex = mdb.mdb.music.map(function(x) {return x['@id']; }).indexOf(i.toString());
if(foundSongIndex != -1) {
var songData = mdb.mdb.music[foundSongIndex];
if(gameVersion === 6 || gameVersion === -6) {
if(!RESTRICT_SONGS.includes(i.toString())) {
if(songData.info.version['#text'] === '6' && currentYMDDate >= parseInt(songData.info.distribution_date['#text'])) {
if(parseInt(songData.info.distribution_date['#text']) >= parseInt(version.toString().substring(0,8))) {
writeLog("Found new song for version " + version + ": " + songData.info.title_name + "(" + songData.info.distribution_date['#text'] + ")");
}
limitedNo = 2;
if(MISSINGSONGS6.includes(i.toString())) {
limitedNo += 1;
}
else if(!U.GetConfig('enable_valk_songs') && (VALKYRIEEXCLUSIVESONGS.includes(i.toString()) && (info.model.split(":")[2] != 'G' || info.model.split(":")[2] != 'H'))){
limitedNo -= 1;
}
for(let j = 0; j < 5; j++) {
songs.push({
music_id: K.ITEM('s32', i),
music_type: K.ITEM('u8', j),
limited: K.ITEM('u8', limitedNo),
});
}
} else if (songData.info.inf_ver['#text'] === '6') {
songs.push({
music_id: K.ITEM('s32', i),
music_type: K.ITEM('u8', 3),
limited: K.ITEM('u8', limitedNo),
});
}
} else {
writeLog("Restricted song: " + songData.info.title_name)
}
}
} }
} }
} }
if(U.GetConfig('use_information')){ if(U.GetConfig('use_information')){
console.log("Sending server information"); writeLog("Sending server information");
let time = new Date(); let time = new Date();
let tempDate = time.getDate(); let tempDate = time.getDate();
const currentTime = parseInt((time.getTime()/100000) as unknown as string)*100; const currentTime = parseInt((time.getTime()/100000) as unknown as string)*100;
@@ -98,10 +169,6 @@ export const common: EPR = async (info, data, send) => {
}); });
} }
if(U.GetConfig('new_year_special')){
events.push('NEW_YEAR_2022');
}
if(U.GetConfig('use_asphyxia_gameover')){ if(U.GetConfig('use_asphyxia_gameover')){
let time = new Date(); let time = new Date();
let tempDate = time.getDate(); let tempDate = time.getDate();
@@ -200,9 +267,94 @@ export const common: EPR = async (info, data, send) => {
} }
console.log("Sending common objects"); writeLog("Sending common objects");
let arena_catalog_items = []
let catalog = []
let campaign = []
if(U.GetConfig('arena_szn') == 'debug') {
for(let xxx = 0; xxx<=20; xxx++){
arena_catalog_items.push({
catalog_id: K.ITEM('s32', 1),
catalog_type: K.ITEM('s32', 1),
price: K.ITEM('s32', 1000),
item_type: K.ITEM('s32', U.GetConfig('arena_debug_item_type')),
item_id: K.ITEM('s32', xxx),
param: K.ITEM('s32', 1),
})
}
}
else{
for (let catalog_item in ARENA[U.GetConfig('arena_szn')].arena_items) {
arena_catalog_items.push({
catalog_id: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].arena_items[catalog_item].catalog_id),
catalog_type: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].arena_items[catalog_item].catalog_type),
price: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].arena_items[catalog_item].price),
item_type: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].arena_items[catalog_item].item_type),
item_id: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].arena_items[catalog_item].item_id),
param: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].arena_items[catalog_item].param),
})
}
}
let valgene_info = []
let valgene_items = []
VALGENE.info.forEach(val => valgene_info.push({
valgene_name: K.ITEM('str', val.valgene_name),
valgene_name_english: K.ITEM('str', val.valgene_name_english),
valgene_id: K.ITEM('s32', val.valgene_id)
}))
VALGENE.catalog.forEach((val) => {
val.items.forEach((itemVal) => {
itemVal.item_ids.forEach((item_id) => {
valgene_items.push({
valgene_id: K.ITEM('s32', val.volume),
rarity: K.ITEM('s32', VALGENE.rarity[itemVal.type.toString()]),
item_type: K.ITEM('s32', itemVal.type),
item_id: K.ITEM('s32', item_id)
})
})
})
})
if(U.GetConfig('april_fools') || currentDate.substring(0,3) === '4/1') {
writeLog('Using April Fools Event')
events.push('APRIL_GRACE');
events.push('EVENTDATE_APRILFOOL');
for (const afsong in APRILFOOLSSONGS) {
for (let j = 0; j < 5; ++j) {
songs.push({
music_id: K.ITEM('s32', parseInt(APRILFOOLSSONGS[afsong])),
music_type: K.ITEM('u8', j),
limited: K.ITEM('u8', 3),
});
}
}
}
if(U.GetConfig('new_year_special')){
writeLog('Using New Year Special BGM')
events.push('NEW_YEAR_2022');
}
console.log(courses[0].id)
send.object( send.object(
{ {
valgene: {
info: valgene_info,
catalog: valgene_items
},
arena: {
season: K.ITEM('s32', ARENA[U.GetConfig('arena_szn')].details.season),
time_start: K.ITEM('u64', ARENA[U.GetConfig('arena_szn')].details.time_start),
time_end: K.ITEM('u64', ARENA[U.GetConfig('arena_szn')].details.time_end),
shop_start: K.ITEM('u64', ARENA[U.GetConfig('arena_szn')].details.shop_start),
shop_end: K.ITEM('u64', ARENA[U.GetConfig('arena_szn')].details.shop_end),
is_open: K.ITEM('bool', ARENA[U.GetConfig('arena_szn')].details.is_open),
is_shop: K.ITEM('bool', ARENA[U.GetConfig('arena_szn')].details.is_shop),
catalog: arena_catalog_items
},
event: { event: {
info: events.map(e => ({ info: events.map(e => ({
event_id: K.ITEM('str', e), event_id: K.ITEM('str', e),
@@ -254,6 +406,14 @@ export const common: EPR = async (info, data, send) => {
}, },
{ encoding: 'utf8' } { encoding: 'utf8' }
); );
},
function(error) {
writeLog('read error: ' + error)
}
);
} catch (error) {
writeLog(error)
}
}; };
@@ -261,3 +421,33 @@ export const log: EPR = async (info, data, send) => {
send.success(); send.success();
} }
export const unhandledt: EPR = async (info, data, send) => {
writeLog("Unhandled: " + info.method + " | " + info.model + " | " + info.module)
writeLog("Info:")
for (let key in info) {
type ObjectKey = keyof typeof info;
const myVar = key as ObjectKey;
if (typeof info[key] === 'object') {
writeLog(key + ' - ' + JSON.stringify(info[key]));
} else writeLog(key + ' - ' + info[key]);
}
writeLog("")
writeLog("Data:")
for (let key in data) {
type ObjectKey = keyof typeof data;
const myVar = key as ObjectKey;
if (typeof data[key] === 'object') {
writeLog(key + ' - ' + JSON.stringify(data[key]));
} else writeLog(key + ' - ' + data[key]);
}
writeLog("")
writeLog("Send:")
for (let key in send) {
type ObjectKey = keyof typeof send;
const myVar = key as ObjectKey;
if (typeof send[key] === 'object') {
writeLog(key + ' - ' + JSON.stringify(send[key]));
} else writeLog(key + ' - ' + send[key]);
}
writeLog('')
}
+82 -4
View File
@@ -2,6 +2,7 @@ import { Skill } from '../models/skill';
import { SDVX_AUTOMATION_SONGS } from '../data/vvw'; import { SDVX_AUTOMATION_SONGS } from '../data/vvw';
import { Item } from '../models/item'; import { Item } from '../models/item';
import { Param } from '../models/param'; import { Param } from '../models/param';
import { Arena } from '../models/arena';
import { MusicRecord } from '../models/music_record'; import { MusicRecord } from '../models/music_record';
import { CourseRecord } from '../models/course_record'; import { CourseRecord } from '../models/course_record';
import { Profile } from '../models/profile'; import { Profile } from '../models/profile';
@@ -365,6 +366,7 @@ export const saveCourse: EPR = async (info, data, send) => {
}; };
export const save: EPR = async (info, data, send) => { export const save: EPR = async (info, data, send) => {
console.log($(data))
const refid = $(data).str('refid', $(data).attr().refid); const refid = $(data).str('refid', $(data).attr().refid);
if (!refid) return send.deny(); if (!refid) return send.deny();
@@ -404,6 +406,9 @@ export const save: EPR = async (info, data, send) => {
// Save Profile // Save Profile
if (version === 6) { if (version === 6) {
console.log(JSON.stringify($(data)))
console.log("packet: " + $(data).number('earned_gamecoin_packet'))
console.log("block: " + $(data).number('earned_gamecoin_block'))
await DB.Update<Profile>( await DB.Update<Profile>(
refid, refid,
{ collection: 'profile' }, { collection: 'profile' },
@@ -433,6 +438,15 @@ export const save: EPR = async (info, data, send) => {
blocks: $(data).number('earned_gamecoin_block'), blocks: $(data).number('earned_gamecoin_block'),
blasterEnergy: $(data).number('earned_blaster_energy'), blasterEnergy: $(data).number('earned_blaster_energy'),
extrackEnergy: $(data).number('earned_extrack_energy'), extrackEnergy: $(data).number('earned_extrack_energy'),
playCount: 1,
dayCount: 1,
todayCount: 1,
playChain: 1,
maxPlayChain: 1,
weekCount: 1,
weekPlayCount: 1,
weekChain: 1,
maxWeekChain: 1
}, },
} }
); );
@@ -466,6 +480,15 @@ export const save: EPR = async (info, data, send) => {
packets: $(data).number('earned_gamecoin_packet'), packets: $(data).number('earned_gamecoin_packet'),
blocks: $(data).number('earned_gamecoin_block'), blocks: $(data).number('earned_gamecoin_block'),
blasterEnergy: $(data).number('earned_blaster_energy'), blasterEnergy: $(data).number('earned_blaster_energy'),
playCount: 1,
dayCount: 1,
todayCount: 1,
playChain: 1,
maxPlayChain: 1,
weekCount: 1,
weekPlayCount: 1,
weekChain: 1,
maxWeekChain: 1
}, },
} }
); );
@@ -545,6 +568,35 @@ export const save: EPR = async (info, data, send) => {
} }
); );
// Save Arena Data
const arena_data = $(data).elements('arena');
for (const are of arena_data) {
const earnedUR = are.number('earned_ultimate_rate');
const earnedSP = are.number('earned_shop_point');
const earnedRP = are.number('earned_rank_point');
const earnedLE = are.number('earned_live_energy');
const rankPlay = are.str('rank_play') == 'true' ? 1 : 0;
const ultimatePlay = are.str('ultimate_play') == 'true' ? 1 : 0;
await DB.Upsert<Arena>(
refid,
{
collection: 'arena'
},
{
$inc: {
ultimateRate: _.isNil(earnedUR) ? 0 : earnedUR,
shopPoint: _.isNil(earnedSP) ? 0 : earnedSP,
rankPoint: _.isNil(earnedRP) ? 0 : earnedRP,
liveEnergy: _.isNil(earnedLE) ? 0 : earnedLE,
rankCount: rankPlay,
ultimateCount: ultimatePlay
}
}
);
console.log(earnedSP)
}
return send.success(); return send.success();
}; };
@@ -554,8 +606,8 @@ export const load: EPR = async (info, data, send) => {
if (!refid) return send.deny(); if (!refid) return send.deny();
const version = Math.abs(getVersion(info)); const version = Math.abs(getVersion(info));
console.log("Got version" + version); console.log("Got version: " + version);
console.log("DataID" + refid); console.log("DataID: " + refid);
if (version == 0) return send.deny(); if (version == 0) return send.deny();
const profile = await DB.FindOne<Profile>(refid, { const profile = await DB.FindOne<Profile>(refid, {
@@ -575,6 +627,7 @@ export const load: EPR = async (info, data, send) => {
const courses = await DB.Find<CourseRecord>(refid, { collection: 'course', version }); const courses = await DB.Find<CourseRecord>(refid, { collection: 'course', version });
const items = await DB.Find<Item>(refid, { collection: 'item' }); const items = await DB.Find<Item>(refid, { collection: 'item' });
const params = await DB.Find<Param>(refid, { collection: 'param' }); const params = await DB.Find<Param>(refid, { collection: 'param' });
const arena = await DB.FindOne<Arena>(refid, { collection: 'arena' });
let time = new Date(); let time = new Date();
let tempHour = time.getHours(); let tempHour = time.getHours();
let tempDate = time.getDate(); let tempDate = time.getDate();
@@ -614,7 +667,7 @@ export const load: EPR = async (info, data, send) => {
const customize = []; const customize = [];
customize.push(bgm, subbg, nemsys, stampA, stampB, stampC, stampD); customize.push(bgm, subbg, nemsys, stampA, stampB, stampC, stampD);
console.log("ARENA POINTS: " + arena['shopPoint'])
var tempCustom = params.findIndex((e) => (e.type == 2 && e.id == 2)) var tempCustom = params.findIndex((e) => (e.type == 2 && e.id == 2))
@@ -650,6 +703,7 @@ export const load: EPR = async (info, data, send) => {
blasterpass, blasterpass,
automation: version == 5 ? SDVX_AUTOMATION_SONGS : [], automation: version == 5 ? SDVX_AUTOMATION_SONGS : [],
code: IDToCode(profile.id), code: IDToCode(profile.id),
arena,
...profile, ...profile,
}); });
}; };
@@ -702,7 +756,9 @@ export const create: EPR = async (info, data, send) => {
sortType: 0, sortType: 0,
expPoint: 0, expPoint: 0,
mUserCnt: 0, mUserCnt: 0,
boothFrame: [0, 0, 0, 0, 0] boothFrame: [0, 0, 0, 0, 0],
playCount: 0
}; };
await DB.Upsert(refid, { collection: 'profile' }, profile); await DB.Upsert(refid, { collection: 'profile' }, profile);
@@ -710,6 +766,7 @@ export const create: EPR = async (info, data, send) => {
}; };
export const buy: EPR = async (info, data, send) => { export const buy: EPR = async (info, data, send) => {
console.log("buying")
const refid = $(data).str('refid'); const refid = $(data).str('refid');
if (!refid) return send.deny(); if (!refid) return send.deny();
@@ -777,3 +834,24 @@ export const print: EPR = async (info, data, send) => {
})) }))
}), { status: "0" }; }), { status: "0" };
} }
export const saveValgene: EPR = async (info, data, send) => {
console.log("Saving Valkyrie Generator Item")
const refid = $(data).str('refid');
const items = $(data).elements('item.info');
for (const i of items) {
const type = i.number('type');
const id = i.number('id');
const param = i.number('param');
if (_.isNil(type) || _.isNil(id) || _.isNil(param)) continue;
await DB.Upsert<Item>(
refid,
{ collection: 'item', type, id },
{ $set: { param } }
);
}
return send.object({ result: K.ITEM('u8', 0) });
}
+31 -3
View File
@@ -1,4 +1,4 @@
import {common,log} from './handlers/common'; import {common,log,unhandledt} from './handlers/common';
import {hiscore, rival, saveMix, loadMix, globalMatch} from './handlers/features'; import {hiscore, rival, saveMix, loadMix, globalMatch} from './handlers/features';
import { import {
updateProfile, updateProfile,
@@ -15,7 +15,15 @@ import {
saveCourse, saveCourse,
buy, buy,
print, print,
saveValgene,
} from './handlers/profiles'; } from './handlers/profiles';
import {
generateLatestMusicDBFile,
copyResourcesFromGame
} from './utils'
import {
ARENA
} from './data/exg';
export function register() { export function register() {
@@ -25,11 +33,19 @@ export function register() {
R.Config('unlock_all_songs', { type: 'boolean', default: false, name:'Unlock All Songs'}); R.Config('unlock_all_songs', { type: 'boolean', default: false, name:'Unlock All Songs'});
R.Config('unlock_all_navigators', { type: 'boolean', default: false, name:'Unlock All Navigators'} ); R.Config('unlock_all_navigators', { type: 'boolean', default: false, name:'Unlock All Navigators'} );
R.Config('unlock_all_appeal_cards', { type: 'boolean', default: false, name:'Unlock All Appeal Cards'}); R.Config('unlock_all_appeal_cards', { type: 'boolean', default: false, name:'Unlock All Appeal Cards'});
R.Config('unlock_all_valk_items', { type: 'boolean', default: false, name:'Unlock All Valkyrie Items', desc: 'Unlock Nemsys, BGM, Submonitor BG and Stamp Items (Valk crews not included; check \'unlock all navigators\' option)'});
R.Config('use_information' ,{ type: 'boolean', default: true, name:'Use Information', desc:'Enable the information section after entry.'}); R.Config('use_information' ,{ type: 'boolean', default: true, name:'Use Information', desc:'Enable the information section after entry.'});
R.Config('enable_valk_songs' ,{ type: 'boolean', default: false, name:'Enable Valkyrie Model Songs', desc:'Unlock the valkyrie model songs on non-valkyrie mode.'});
R.Config('use_asphyxia_gameover',{ type: 'boolean', default: true, name:'Use Asphyxia Gameover', desc:'Enable the Asphyxia gameover message after ending the game.'}) R.Config('use_asphyxia_gameover',{ type: 'boolean', default: true, name:'Use Asphyxia Gameover', desc:'Enable the Asphyxia gameover message after ending the game.'})
R.Config('sdvx_eg_root_dir', { type: 'string', needRestart: true, default: '', name: 'Exceed Gear Data Directory', desc: 'The root directory of your SDVX Exceed Gear game files (for asset copying)'});
R.Config('use_blasterpass',{ type: 'boolean', default: true, name:'Use Blaster Pass', desc:'Enable Blaster Pass for VW and EG'}); R.Config('use_blasterpass',{ type: 'boolean', default: true, name:'Use Blaster Pass', desc:'Enable Blaster Pass for VW and EG'});
R.Config('new_year_special',{ type: 'boolean', default: true, name:'Use New Year Special', desc:'Enable New Year Special BGM for login'}); R.Config('new_year_special',{ type: 'boolean', default: false, name:'Use New Year Special', desc:'Enable New Year Special BGM for login (needs checking)'});
R.Config('april_fools',{ type: 'boolean', default: false, name:'April Fools', desc:'Enable April Fools Event (needs checking)'});
R.Config('arena_szn',{ type: 'string', options: Object.keys(ARENA), default: 'Set 1 (04/25/22)', name: 'Arena Station Item Set', desc: 'Choose which season set of items in the arena station you want to show up in arena station'});
R.Config('debug_log_toggle', { type: 'boolean', default: true, name:'Toggle Logging'});
R.WebUIEvent('generateLatestMusicDBFile', generateLatestMusicDBFile);
R.WebUIEvent('copyResourcesFromGame', copyResourcesFromGame);
R.WebUIEvent('updateProfile', updateProfile); R.WebUIEvent('updateProfile', updateProfile);
R.WebUIEvent('updateMix', updateMix); R.WebUIEvent('updateMix', updateMix);
R.WebUIEvent('importMix', importMix); R.WebUIEvent('importMix', importMix);
@@ -55,6 +71,7 @@ export function register() {
MultiRoute('save', save); MultiRoute('save', save);
MultiRoute('save_m', saveScore); MultiRoute('save_m', saveScore);
MultiRoute('save_c', saveCourse); MultiRoute('save_c', saveCourse);
MultiRoute('save_valgene', saveValgene);
MultiRoute('frozen', true); MultiRoute('frozen', true);
MultiRoute('buy', buy); MultiRoute('buy', buy);
MultiRoute('print',print); MultiRoute('print',print);
@@ -81,6 +98,16 @@ export function register() {
MultiRoute('exception', true); MultiRoute('exception', true);
MultiRoute('log',log); MultiRoute('log',log);
/*
print_h
sample
save_campaign
save_fi
save_pb
save_valgene - DONE
serial
*/
R.Route('eventlog.write', (_, __, send) => send.object({ R.Route('eventlog.write', (_, __, send) => send.object({
gamesession: K.ITEM('s64', BigInt(1)), gamesession: K.ITEM('s64', BigInt(1)),
logsendflg: K.ITEM('s32', 0), logsendflg: K.ITEM('s32', 0),
@@ -100,5 +127,6 @@ export function register() {
})); }));
R.Unhandled(); // R.Unhandled();
R.Unhandled(unhandledt);
} }
+10
View File
@@ -0,0 +1,10 @@
export interface Arena {
collection: 'arena';
last_play_season: number;
rank_point: number;
shop_point: number;
ultimate_rate: number;
rank_play_cnt: number;
ultimate_play_cnt: number;
}
+2
View File
@@ -43,4 +43,6 @@ export interface Profile {
stampD: number; stampD: number;
boothFrame: number[]; boothFrame: number[];
playCount: number;
} }
+27 -9
View File
@@ -86,15 +86,24 @@ game
id(__type="s32") #{id} id(__type="s32") #{id}
param(__type="s32" __count="1") #{akaname} param(__type="s32" __count="1") #{akaname}
play_count(__type="u32") 1001 if playCount
day_count(__type="u32") 301 play_count(__type="u32") #{playCount}
today_count(__type="u32") 21 if dayCount
play_chain(__type="u32") 31 day_count(__type="u32") #{dayCount}
max_play_chain(__type="u32") 31 if todayCount
week_count(__type="u32") 9 today_count(__type="u32") #{todayCount}
week_play_count(__type="u32") 101 if playChain
week_chain(__type="u32") 31 play_chain(__type="u32") #{playChain}
max_week_chain(__type="u32") 31 if maxPlayChain
max_play_chain(__type="u32") #{maxPlayChain}
if weekCount
week_count(__type="u32") #{weekCount}
if weekPlayCount
week_play_count(__type="u32") #{weekPlayCount}
if weekChain
week_chain(__type="u32") #{weekChain}
if maxWeekChain
max_week_chain(__type="u32") #{maxWeekChain}
if mixes if mixes
each mix in mixes each mix in mixes
@@ -109,3 +118,12 @@ game
jacket_id(__type="s32") #{mix.jacket} jacket_id(__type="s32") #{mix.jacket}
tag_bit(__type="s32") #{mix.tag} tag_bit(__type="s32") #{mix.tag}
like_flg(__type="u8") 0 like_flg(__type="u8") 0
if arena
arena
ultimate_rate(__type="s32") #{arena.ultimateRate}
shop_point(__type="s32") #{arena.shopPoint}
rank_point(__type="s32") #{arena.rankPoint}
live_energy(__type="s32") #{arena.liveEnergy}
rank_play_cnt(__type="s32") #{arena.rankCount}
ultimate_play_cnt(__type="s32") #{arena.ultimateCount}
+168
View File
@@ -31,3 +31,171 @@ export function getRandomIntInclusive(min, max) {
max = Math.floor(max); max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive return Math.floor(Math.random() * (max - min + 1) + min); //The maximum is inclusive and the minimum is inclusive
} }
export const copyResourcesFromGame = async (data: {}) => {
let resourceJsonData = JSON.parse(U.DecodeString(await IO.ReadFile('webui\\asset\\json\\data.json'), 'utf8'))
let newNemsysData = []
let newAPCardData = []
let newSubBGData = []
// Copying new nemsys files from gamedata
console.log("Copying new nemsys files from gamedata")
let nemsysFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\game_nemsys")
for await (const nemsys of nemsysFiles) {
let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\game_nemsys\\" + nemsys.name)
if(!IO.Exists('webui\\asset\\nemsys\\' + nemsys.name.substring(0, (nemsys.name.length - 4)) + ".png") && !IO.Exists('webui\\asset\\nemsys\\' + nemsys.name.substring(0, (nemsys.name.length - 4)) + ".jpg")) {
IO.WriteFile('webui\\test_asset\\nemsys\\' + nemsys.name, fileToWrite)
newNemsysData.push(nemsys.name)
} else {
console.log(nemsys.name + " exists")
}
}
newNemsysData.forEach(fileName => {
if(parseInt(fileName.substring(7, 11))) {
resourceJsonData.nemsys.push({"value": parseInt(fileName.substring(7, 11)), "name": fileName + " (please rename)"})
}
})
// Copying new appeal card files from gamedata
console.log("Copying new appeal card files from gamedata")
let apCardFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\ap_card")
for await (const apCard of apCardFiles) {
let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\ap_card\\" + apCard.name)
if(!IO.Exists('webui\\asset\\ap_card\\' + apCard.name.substring(0, (apCard.name.length - 4)) + ".png") && !IO.Exists('webui\\asset\\ap_card\\' + apCard.name.substring(0, (apCard.name.length - 4)) + ".jpg")) {
IO.WriteFile('webui\\test_asset\\ap_card\\' + apCard.name, fileToWrite)
newAPCardData.push(apCard.name)
} else {
console.log(apCard.name + " exists")
}
}
// Copying new subbg files from gamedata
console.log("Copying new subbg files from gamedata")
let subBGFiles = await IO.ReadDir(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg")
for await (const subbg of subBGFiles) {
let fileToWrite = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\graphics\\submonitor_bg\\" + subbg.name)
if(!IO.Exists('webui\\asset\\submonitor_bg\\' + subbg.name.substring(0, (subbg.name.length - 4)) + ".png") && !IO.Exists('webui\\asset\\submonitor_bg\\' + subbg.name.substring(0, (subbg.name.length - 4)) + ".jpg")) {
IO.WriteFile('webui\\test_asset\\submonitor_bg\\' + subbg.name, fileToWrite)
newSubBGData.push(subbg.name)
} else {
console.log(subbg.name + " exists")
}
}
newSubBGData.forEach(fileName => {
if(parseInt(fileName.substring(6, 10))) {
resourceJsonData.subbg.push({"value": parseInt(fileName.substring(6, 10)), "name": fileName + " (please rename)"})
}
})
await IO.WriteFile('webui\\test_asset\\data.json', JSON.stringify(resourceJsonData))
await IO.WriteFile('webui\\asset\\logs\\copyResourcesFromGame.json', JSON.stringify({
nemsys: newNemsysData,
apCard: newAPCardData,
subbg: newSubBGData
}))
}
export const generateLatestMusicDBFile = async (data: {}) => {
var version = '';
IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\prop\\ea3-config.xml").then(
function(value){
let configJson = U.parseXML(U.DecodeString(value, "shift_jis"), false)
version = configJson['ea3']['soft']['ext']['@content'];
},
function(error){
console.log(error)
return null;
}
);
var mdbJson;
var mdbJsonFix = [];
var mdbJsonFixFinal;
var mdb = await IO.ReadFile(U.GetConfig('sdvx_eg_root_dir') + "\\data\\others\\music_db.xml").then(
function(value){
mdbJson = U.parseXML(U.DecodeString(value, "shift_jis"), false)
try {
mdbJson.mdb.music.forEach(musicValue => {
if(parseInt(musicValue.info.distribution_date['@content'][0]) >= parseInt(version.substring(0,8))) {
console.log("Found new song for version " + version + ": " + musicValue.info.title_name['@content'] + " (" + musicValue.info.distribution_date['@content'] + ")");
}
mdbJsonFix.push({
'@id': musicValue['@attr'].id,
'info': {
'title_name': musicValue.info.title_name['@content'],
'version': {
'@__type': 'u8',
'#text': musicValue.info.version['@content'][0].toString()
},
'inf_ver': {
'@__type': 'u8',
'#text': musicValue.info.inf_ver['@content'][0].toString()
},
'distribution_date' : {
'#text': musicValue.info.distribution_date['@content'][0]
}
},
'difficulty': {
'novice': {
'difnum': {
'@__type': 'u8',
'#text': musicValue.difficulty.novice.difnum['@content'][0].toString()
}
},
'advanced': {
'difnum': {
'@__type': 'u8',
'#text': musicValue.difficulty.advanced.difnum['@content'][0].toString()
}
},
'exhaust': {
'difnum': {
'@__type': 'u8',
'#text': musicValue.difficulty.exhaust.difnum['@content'][0].toString()
}
},
'maximum': {
'difnum': {
'@__type': 'u8',
'#text': musicValue.difficulty.maximum != undefined ? musicValue.difficulty.maximum.difnum['@content'][0].toString() : '0'
}
},
'infinite': {
'difnum': {
'@__type': 'u8',
'#text': musicValue.difficulty.infinite != undefined ? musicValue.difficulty.infinite.difnum['@content'][0].toString() : '0'
}
}
}
});
})
} catch (err) {
console.log(err)
}
try{
mdbJsonFixFinal = {
'mdb': {
'version': version,
'music': mdbJsonFix
}
};
IO.WriteFile('webui\\asset\\json\\music_db.json', JSON.stringify(mdbJsonFixFinal));
if(!IO.Exists('webui\\asset\\json\\music_db_' + version + '.json')){
IO.WriteFile('webui\\asset\\json\\music_db_' + version + '.json', JSON.stringify(mdbJsonFixFinal));
}
} catch(err) {
console.log(err)
}
return mdbJsonFixFinal;
},
function(error){
console.log(error);
return null;
}
);
console.log(mdb.mdb.version)
return mdb;
}
@@ -0,0 +1,22 @@
//DATA//
sdvx_dir: U.GetConfig('sdvx_eg_root_dir')
-
div
.card
.card-header
p.card-header-title
span.icon
i.mdi.mdi-account-edit
| Update WebUI Resources (pull from game files)
.card-content
.field
button.button.is-primary(type="update" id="updateResources")
span.icon
i.mdi.mdi-check
span Update
.field
textarea(style="width: 100%; height: 100%; background: #4a4a4a; color: #ffffff; border-radius: 6px; padding: 5px; font-size: 15px" rows="50" id="logtextarea" name="logtextarea")
script(src="https://requirejs.org/docs/release/2.3.5/minified/require.js")
script(type="text/javascript" src="static/asset/js/updateResources.js")
div(hidden id='sdvx-dir') !{sdvx_dir}
+2
View File
@@ -103,6 +103,8 @@ function getDifficulty(musicid, type) {
return "HVN"; return "HVN";
case "5": case "5":
return "VVD"; return "VVD";
case "6":
return "XCD";
} }
} }
case 4: case 4:
+1 -1
View File
@@ -201,7 +201,7 @@ function calculateVolforce() {
return toFixed(VF, 3); return toFixed(VF, 3);
} }
var diffName = ["NOV", "ADV", "EXH", "INF\nGRV\nHVN\nVVD", "MXM"]; var diffName = ["NOV", "ADV", "EXH", "INF\nGRV\nHVN\nVVD\nXCD", "MXM"];
function preSetTableMark(type) { function preSetTableMark(type) {
$('#statistic-table').empty(); $('#statistic-table').empty();
+18 -2
View File
@@ -38,8 +38,8 @@ $('[name="bgm"]').change(function() {
$('#custom_0').attr("src", "static/asset/audio/custom_" + zeroPad($('[name="bgm"]').val(), 2) + "/0.mp3"); $('#custom_0').attr("src", "static/asset/audio/custom_" + zeroPad($('[name="bgm"]').val(), 2) + "/0.mp3");
$('#custom_1').attr("src", "static/asset/audio/custom_" + zeroPad($('[name="bgm"]').val(), 2) + "/1.mp3"); $('#custom_1').attr("src", "static/asset/audio/custom_" + zeroPad($('[name="bgm"]').val(), 2) + "/1.mp3");
if ($('[name="bgm"]').val() == 99) { if ($('[name="bgm"]').val() == 99) {
$('#custom_0').attr("src", "static/asset/audio/special_00/0.m4a"); $('#custom_0').attr("src", "static/asset/audio/special_00/0.mp3");
$('#custom_1').attr("src", "static/asset/audio/custom_00/1.m4a"); $('#custom_1').attr("src", "static/asset/audio/custom_00/1.mp3");
} }
$('#custom_0').prop("volume", 0.5); $('#custom_0').prop("volume", 0.5);
$('#custom_1').prop("volume", 0.2); $('#custom_1').prop("volume", 0.2);
@@ -124,6 +124,13 @@ var play_bgm = false;
var play_sel = false; var play_sel = false;
$(document).ready(function() { $(document).ready(function() {
profile_data = JSON.parse(document.getElementById("data-pass").innerText); profile_data = JSON.parse(document.getElementById("data-pass").innerText);
items_crew = JSON.parse(document.getElementById("data-pass-crew").innerText);
items_stamp = JSON.parse(document.getElementById("data-pass-stamp").innerText);
items_subbg = JSON.parse(document.getElementById("data-pass-subbg").innerText);
items_bgm = JSON.parse(document.getElementById("data-pass-bgm").innerText);
items_nemsys = JSON.parse(document.getElementById("data-pass-nemsys").innerText);
unlock_all = (document.getElementById("data-pass-unlock-all").innerText === 'true');
console.log(unlock_all);
$.getJSON("static/asset/json/data.json", function(json) { $.getJSON("static/asset/json/data.json", function(json) {
database = json; database = json;
@@ -132,6 +139,7 @@ $(document).ready(function() {
//console.log(profile_data); //console.log(profile_data);
for (var i in json["nemsys"]) { for (var i in json["nemsys"]) {
if(unlock_all || (json["nemsys"][i].value === 0 || items_nemsys.find(x => x.id === json["nemsys"][i].value))) {
$('#nemsys_select').append($('<option>', { $('#nemsys_select').append($('<option>', {
value: json["nemsys"][i].value, value: json["nemsys"][i].value,
text: json["nemsys"][i].name, text: json["nemsys"][i].name,
@@ -144,9 +152,12 @@ $(document).ready(function() {
} }
//console.log(profile_data["nemsys"]) //console.log(profile_data["nemsys"])
} }
}
$('#nemsys_select').val(profile_data["nemsys"]); $('#nemsys_select').val(profile_data["nemsys"]);
for (var i in json["subbg"]) { for (var i in json["subbg"]) {
if(unlock_all || (json["subbg"][i].value === 0 || items_subbg.find(x => x.id === json["subbg"][i].value))) {
$('[name="subbg"]').append($('<option>', { $('[name="subbg"]').append($('<option>', {
value: json["subbg"][i].value, value: json["subbg"][i].value,
text: json["subbg"][i].name, text: json["subbg"][i].name,
@@ -156,9 +167,11 @@ $(document).ready(function() {
// console.log(image); // console.log(image);
//console.log(profile_data["subbg"]) //console.log(profile_data["subbg"])
} }
}
$('[name="subbg"]').val(profile_data["subbg"]); $('[name="subbg"]').val(profile_data["subbg"]);
for (var i in json["bgm"]) { for (var i in json["bgm"]) {
if(unlock_all || (json["bgm"][i].value === 0 || items_bgm.find(x => parseInt(x.id) === parseInt(json["bgm"][i].value)))) {
$('[name="bgm"]').append($('<option>', { $('[name="bgm"]').append($('<option>', {
value: json["bgm"][i].value, value: json["bgm"][i].value,
text: json["bgm"][i].name, text: json["bgm"][i].name,
@@ -174,6 +187,7 @@ $(document).ready(function() {
//console.log(profile_data["bgm"]) //console.log(profile_data["bgm"])
} }
}
$('[name="bgm"]').val(profile_data["bgm"]); $('[name="bgm"]').val(profile_data["bgm"]);
for (var i in json["akaname"]) { for (var i in json["akaname"]) {
@@ -186,6 +200,7 @@ $(document).ready(function() {
$('[name="akaname"]').val(profile_data["akaname"]); $('[name="akaname"]').val(profile_data["akaname"]);
for (var i in json["stamp"]) { for (var i in json["stamp"]) {
if(unlock_all || (json["stamp"][i].value === 0 || items_stamp.find(x => x.id === json["stamp"][i].value))) {
$('[name="stampA"]').append($('<option>', { $('[name="stampA"]').append($('<option>', {
value: json["stamp"][i].value, value: json["stamp"][i].value,
text: json["stamp"][i].name, text: json["stamp"][i].name,
@@ -216,6 +231,7 @@ $(document).ready(function() {
image.src = "static/asset/chat_stamp/stamp_" + zeroPad(group, 4) + "/stamp_" + zeroPad(group, 4) + "_" + zeroPad(item, 2) + ".png"; image.src = "static/asset/chat_stamp/stamp_" + zeroPad(group, 4) + "/stamp_" + zeroPad(group, 4) + "_" + zeroPad(item, 2) + ".png";
} }
}
}); });
+16 -1
View File
@@ -16,6 +16,15 @@ function getSongName(musicid) {
//console.log(result); //console.log(result);
} }
function getReleaseDate(musicid) {
//console.log(music_db["mdb"]["music"])
//console.log(musicid+" "+type);
var result = music_db["mdb"]["music"].filter(object => object["@id"] == musicid);
return result[0]["info"]["distribution_date"]["#text"]
//console.log(result);
}
function getDifficulty(musicid, type) { function getDifficulty(musicid, type) {
var result = music_db["mdb"]["music"].filter(object => object["@id"] == musicid); var result = music_db["mdb"]["music"].filter(object => object["@id"] == musicid);
if (result.length == 0) { if (result.length == 0) {
@@ -41,6 +50,8 @@ function getDifficulty(musicid, type) {
return "HVN"; return "HVN";
case "5": case "5":
return "VVD"; return "VVD";
case "6":
return "XCD"
} }
} }
case 4: case 4:
@@ -109,8 +120,10 @@ function difficultySort(d) {
return 6; return 6;
case "VVD": case "VVD":
return 7; return 7;
case "MXM": case "XCD":
return 8; return 8;
case "MXM":
return 9;
} }
return 0; return 0;
}; };
@@ -223,6 +236,7 @@ $(document).ready(function() {
temp_data.mid = profile_data[i].mid; temp_data.mid = profile_data[i].mid;
temp_data.songname = getSongName(profile_data[i].mid); temp_data.songname = getSongName(profile_data[i].mid);
temp_data.diff = getDifficulty(profile_data[i].mid, profile_data[i].type); temp_data.diff = getDifficulty(profile_data[i].mid, profile_data[i].type);
temp_data.releasedate = getReleaseDate(profile_data[i].mid);
temp_data.score = profile_data[i].score; temp_data.score = profile_data[i].score;
temp_data.exscore = ((profile_data[i].exscore) ? profile_data[i].exscore : 0); temp_data.exscore = ((profile_data[i].exscore) ? profile_data[i].exscore : 0);
temp_data.grade = getGrade(profile_data[i].grade); temp_data.grade = getGrade(profile_data[i].grade);
@@ -246,6 +260,7 @@ $(document).ready(function() {
{ data: 'mid' }, { data: 'mid' },
{ data: 'songname' }, { data: 'songname' },
{ data: 'diff', "type": "diff" }, { data: 'diff', "type": "diff" },
{ data: 'releasedate'},
{ data: 'score', }, { data: 'score', },
{ data: 'exscore' }, { data: 'exscore' },
{ data: 'grade', "type": "grade" }, { data: 'grade', "type": "grade" },
@@ -0,0 +1,142 @@
function getInfDifficulty(inf_ver) {
switch (inf_ver) {
case "2":
return "INF";
case "3":
return "GRV";
case "4":
return "HVN";
case "5":
return "VVD";
case "6":
return "XCD"
}
}
$(document).ready(function() {
courseData = musicDB = []
versionCourseData = []
courseLevels = []
specificCourse = []
selectedVersion = selectedCourseLevel = selectedSpecificCourse = null
$.getJSON('static/asset/json/course_data.json', function(json) {
courseData = json;
})
$.getJSON("static/asset/json/music_db.json", function(json) {
musicDB = json;
});
$('#savebutton').click(function(){
})
$('#sdvx-version').change(function(){
$('#skill-course').find('option').not(':first').remove();
$('#skill-course-level').find('option').not(':first').remove();
$('.track-name').val('');
$('.track-id').val('');
$('.track-difficulty').val('');
if(this.value != '-- Select --'){
selectedVersion = parseInt(this.value);
selectedCourseLevel = null;
selectedSpecificCourse = null;
versionCourseData = courseData.courseData.find(data => parseInt(data['version']) === selectedVersion).info;
courseLevels = []
specificCourse = []
versionCourseData.forEach(function(item, index){
item.courses.forEach(function(item2, index2) {
if(!courseLevels.some(course => course.includes(item2['name']))) courseLevels.push([item2['name'], item2['id']]);
})
});
$.each(courseLevels, function() {
$('#skill-course').append("<option value=" + this[1] + ">" + this[0] + "</>");
});
}
})
$('#skill-course').change(function(){
$('#skill-course-level').find('option').not(':first').remove();
$('.track-name').val('');
$('.track-id').val('');
$('.track-difficulty').val('');
if(this.value != '-- Select --'){
selectedCourseLevel = parseInt(this.value);
selectedSpecificCourse = null;
specificCourse = []
versionCourseData.forEach(function(item, index){
item.courses.forEach(function(item2, index2) {
if(!specificCourse.some(course => course.includes(item['name'])) && item2['id'] == selectedCourseLevel){
console.log(item['name'] + " included in " + selectedCourseLevel + " in " + selectedVersion)
specificCourse.push([item['name'], item['id']])
}
})
});
$.each(specificCourse, function() {
console.log(specificCourse)
$('#skill-course-level').append("<option value=" + this[1] + ">" + this[0] + "</>");
});
}
})
$('#skill-course-level').change(function(){
if(this.value != '-- Select --'){
selectedSpecificCourse = parseInt(this.value);
theCourse = versionCourseData.find(data => data.id === selectedSpecificCourse).courses
.find(data => data.id === selectedCourseLevel).tracks;
trackIndex = 0;
difficultyLabels = ['Novice', 'Advanced', 'Exhaust', 'Inf/Grv/Hvn/Vvd/Xcd', 'Maximum']
infLabel = ['0', '1', 'Infinite', 'Gravity', 'Heavenly', 'Vivid', 'Exceed']
musicDBDifficultyLabel = ['novice', 'advanced', 'exhaust', 'infinite', 'maximum']
theCourse.forEach(function(courseTrack){
track = musicDB.mdb.music.find(data => parseInt(courseTrack.mid) === parseInt(data['@id']))
// console.log(courseTrack.mty)
if(courseTrack.mty == 3) {
difficultyLabel = infLabel[parseInt(track.info.inf_ver['#text'])]
} else {
difficultyLabel = difficultyLabels[courseTrack.mty]
}
console.log(courseTrack.mid)
$(".track-id").eq(trackIndex).val(track['@id'])
$(".track-name").eq(trackIndex).val(track.info.title_name)
$(".track-name").eq(trackIndex).attr('track-id', track['@id'])
$('.track-difficulty').eq(trackIndex).find('option').not(':first').remove();
$(".track-difficulty").eq(trackIndex).append("<option value=" + 0 + ">" + difficultyLabels[0] + ' (' + track.difficulty['novice'].difnum['#text'] + ")</option>")
$(".track-difficulty").eq(trackIndex).append("<option value=" + 1 + ">" + difficultyLabels[1] + ' (' + track.difficulty['advanced'].difnum['#text'] + ")</option>")
$(".track-difficulty").eq(trackIndex).append("<option value=" + 2 + ">" + difficultyLabels[2] + ' (' + track.difficulty['exhaust'].difnum['#text'] + ")</option>")
if(track.difficulty['maximum'].difnum['#text'] != '0' || track.difficulty['infinite'].difnum['#text'] != '0'){
$(".track-difficulty").eq(trackIndex).append("<option value=" + ((courseTrack.mty == 3) ? 3 : 4) + ">" + (track.difficulty['infinite'].difnum['#text'] != '0' ? infLabel[parseInt(track.info.inf_ver['#text'])] : difficultyLabels[4]) + ' (' + (track.difficulty['infinite'].difnum['#text'] != '0' ? track.difficulty['infinite'].difnum['#text'] : track.difficulty['maximum'].difnum['#text']) + ")</option>")
}
$(".track-difficulty").eq(trackIndex).val(courseTrack.mty)
$(".track-difficulty").eq(trackIndex).attr('diff-id', courseTrack.mty)
trackIndex++;
})
}
})
$('.track-id').on('input', function(){
searchTrackID = parseInt(this.value);
var that_ = this;
var currentIndex = $('.track-id').index(that_);
difficultyLabels = ['Novice', 'Advanced', 'Exhaust', 'Inf/Grv/Hvn/Vvd/Xcd', 'Maximum']
infLabel = ['0', '1', 'Infinite', 'Gravity', 'Heavenly', 'Vivid', 'Exceed']
musicDBDifficultyLabel = ['novice', 'advanced', 'exhaust', 'infinite', 'maximum']
track = musicDB.mdb.music.find(data => searchTrackID === parseInt(data['@id']))
if(track){
$(".track-name").eq(currentIndex).val(track.info.title_name)
$(".track-name").eq(currentIndex).attr('track-id', track['@id'])
$('.track-difficulty').eq(currentIndex).find('option').not(':first').remove();
$(".track-difficulty").eq(currentIndex).append("<option value=" + 0 + ">" + difficultyLabels[0] + ' (' + track.difficulty['novice'].difnum['#text'] + ")</option>")
$(".track-difficulty").eq(currentIndex).append("<option value=" + 1 + ">" + difficultyLabels[1] + ' (' + track.difficulty['advanced'].difnum['#text'] + ")</option>")
$(".track-difficulty").eq(currentIndex).append("<option value=" + 2 + ">" + difficultyLabels[2] + ' (' + track.difficulty['exhaust'].difnum['#text'] + ")</option>")
if(track.difficulty['maximum'].difnum['#text'] != '0' || track.difficulty['infinite'].difnum['#text'] != '0'){
$(".track-difficulty").eq(currentIndex).append("<option value=" + ((parseInt(track.info.inf_ver['#text']) != 0) ? 3 : 4) + ">" + (track.difficulty['infinite'].difnum['#text'] != '0' ? infLabel[parseInt(track.info.inf_ver['#text'])] : difficultyLabels[4]) + ' (' + (track.difficulty['infinite'].difnum['#text'] != '0' ? track.difficulty['infinite'].difnum['#text'] : track.difficulty['maximum'].difnum['#text']) + ")</option>")
}
$(".track-difficulty").eq(currentIndex).val('-- Select --')
$(".track-difficulty").eq(currentIndex).attr('diff-id', 0)
} else {
$(".track-name").eq(currentIndex).val('')
$(".track-name").eq(currentIndex).attr('track-id', 0)
$('.track-difficulty').eq(currentIndex).find('option').not(':first').remove();
}
})
})
+130
View File
@@ -0,0 +1,130 @@
function getInfDifficulty(inf_ver) {
switch (inf_ver) {
case "2":
return "INF";
case "3":
return "GRV";
case "4":
return "HVN";
case "5":
return "VVD";
case "6":
return "XCD"
}
}
$(document).ready(function() {
// jQuery.fn.dataTableExt.oSort['diff-asc'] = function(a, b) {
// var x = difficultySort(a);
// var y = difficultySort(b);
// return ((x < y) ? -1 : ((x > y) ? 1 : 0));
// };
// jQuery.fn.dataTableExt.oSort['diff-desc'] = function(a, b) {
// var x = difficultySort(a);
// var y = difficultySort(b);
// return ((x < y) ? 1 : ((x > y) ? -1 : 0));
// };
// jQuery.fn.dataTableExt.oSort['grade-asc'] = function(a, b) {
// var x = gradeSort(a);
// var y = gradeSort(b);
// return ((x < y) ? -1 : ((x > y) ? 1 : 0));
// };
// jQuery.fn.dataTableExt.oSort['grade-desc'] = function(a, b) {
// var x = gradeSort(a);
// var y = gradeSort(b);
// return ((x < y) ? 1 : ((x > y) ? -1 : 0));
// };
// jQuery.fn.dataTableExt.oSort['clear-mark-asc'] = function(a, b) {
// var x = markSort(a);
// var y = markSort(b);
// return ((x < y) ? -1 : ((x > y) ? 1 : 0));
// };
// jQuery.fn.dataTableExt.oSort['clear-mark-desc'] = function(a, b) {
// var x = markSort(a);
// var y = markSort(b);
// return ((x < y) ? 1 : ((x > y) ? -1 : 0));
// };
// var profile_data = JSON.parse(document.getElementById("data-pass").innerText);
// profile_data = profile_data.sort(function(a, b) {
// if (a.mid > b.mid) return 1;
// if (a.mid < b.mid) return -1;
// return a.type > b.type ? 1 : -1;
// });
//console.log(profile_data);
//$('#music_score').DataTable();
$.getJSON("static/asset/json/music_db.json", function(json) {
music_db = json;
var music_data = [];
for (let mdata in music_db.mdb.music) {
var temp_data = {};
temp_data.mid = music_db.mdb.music[mdata]['@id'];
temp_data.songname = music_db.mdb.music[mdata]['info']['title_name'];
temp_data.releasedate = music_db.mdb.music[mdata]['info']['distribution_date']['#text'];
temp_data.nov = "";
temp_data.adv = "";
temp_data.exh = "";
temp_data.mxm = "";
temp_data.oth = "";
if (music_db.mdb.music[mdata]['difficulty']['novice']['difnum']['#text'] != 0) {
temp_data.nov = music_db.mdb.music[mdata]['difficulty']['novice']['difnum']['#text']
}
if (music_db.mdb.music[mdata]['difficulty']['advanced']['difnum']['#text'] != 0) {
temp_data.adv = music_db.mdb.music[mdata]['difficulty']['advanced']['difnum']['#text']
}
if (music_db.mdb.music[mdata]['difficulty']['exhaust']['difnum']['#text'] != 0) {
temp_data.exh = music_db.mdb.music[mdata]['difficulty']['exhaust']['difnum']['#text']
}
if (music_db.mdb.music[mdata]['difficulty']['maximum']['difnum']['#text'] != 0) {
temp_data.mxm = music_db.mdb.music[mdata]['difficulty']['maximum']['difnum']['#text']
}
if (music_db.mdb.music[mdata]['info']['inf_ver']['#text'] != 0) {
temp_data.oth = music_db.mdb.music[mdata]['difficulty']['infinite']['difnum']['#text'] + ' | ' + getInfDifficulty(music_db.mdb.music[mdata]['info']['inf_ver']['#text'])
}
music_data.push(temp_data);
}
$('#songslist').DataTable({
data: music_data,
columns: [
{ data: 'mid' },
{ data: 'songname' },
{ data: 'releasedate' },
{ data: 'nov', },
{ data: 'adv' },
{ data: 'exh' },
{ data: 'mxm' },
{ data: 'oth' }
],
columnDefs: [
],
responsive: {
details: {
display: $.fn.dataTable.Responsive.display.modal({
header: function(row) {
var data = row.data();
return 'Details for ' + data.songname;
}
})
}
},
});
});
})
@@ -0,0 +1,55 @@
// data\graphics\game_nemsys -- nemsys
// data\graphics\ap_card -- appeal card
// data\graphics\submonitor_bg -- subbg
$(document).ready(async function() {
let sdvxDir = document.getElementById("sdvx-dir").innerText
$( "#updateResources" ).click(async function() {
answer = confirm("Clicking OK would mean that you have already updated the datecode in your ea3-config.xml file. Would you like to proceed?");
if (answer == true) {
document.getElementById("logtextarea").textContent = ''
document.getElementById("logtextarea").textContent = 'Updating music_db.json file....\n'
await emit("generateLatestMusicDBFile").then(
function(response) {
$.getJSON( "static/asset/json/music_db.json", function( data ) {
document.getElementById("logtextarea").textContent += "New songs found in version " + data['mdb']['version'] + ": \n";
$.each( data['mdb']['music'], function( key, val ) {
if(parseInt(val.info.distribution_date['#text']) >= parseInt(data['mdb']['version'].substring(0,8))){
document.getElementById("logtextarea").textContent += val.info.distribution_date['#text'] + " - " + val.info.title_name + "\n";
}
});
document.getElementById("logtextarea").textContent += '\n\n'
});
},
function(error) {
document.getElementById("logtextarea").textContent += error + "\n";
document.getElementById("logtextarea").textContent += "Please check if 'Exceed Gear Data Directory' is configured properly." + "\n";
}
);
await emit("copyResourcesFromGame").then(
function(response){
$.getJSON( "static/asset/logs/copyResourcesFromGame.json", function( data ) {
document.getElementById("logtextarea").textContent += 'New nemsys: \n'
$.each(data['nemsys'], function(key, val) {
document.getElementById("logtextarea").textContent += val + '\n'
})
document.getElementById("logtextarea").textContent += '\n\n'
document.getElementById("logtextarea").textContent += 'New appeal cards: \n'
$.each(data['apCard'], function(key, val) {
document.getElementById("logtextarea").textContent += val + '\n'
})
document.getElementById("logtextarea").textContent += '\n\n'
document.getElementById("logtextarea").textContent += 'New submonitor backgrounds: \n'
$.each(data['subbg'], function(key, val) {
document.getElementById("logtextarea").textContent += val + '\n'
})
document.getElementById("logtextarea").textContent += '\n\n'
})
},
function(error){
console.log(error);
}
)
}
});
})
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"nemsys":["nemsys_0008.png","nemsys_0009.png","nemsys_0011.png","nemsys_0021.png","nemsys_0022.png","nemsys_0023.png","nemsys_0024.png","nemsys_0025.png","nemsys_0026.png","nemsys_0027.png","nemsys_0028.png","nemsys_0029.png","nemsys_0030.png","nemsys_0031.png"],"apCard":["ap_06_R0002.png","ap_06_R0003.png","ap_06_R0004.png","ap_06_R0005.png","ap_06_R0006.png","ap_06_R0007.png","ap_06_R0008.png","ap_06_R0009.png","ap_06_R0010.png","ap_06_R0011.png"],"subbg":["subbg_0103.png","subbg_0104.png","subbg_0105.png","subbg_0106.png","subbg_0107.png","subbg_0108.png","subbg_0109.png","subbg_0110.png","subbg_0111.png","subbg_0112.png","subbg_0113.png","subbg_0114.png","subbg_0115.png","subbg_0116.png","subbg_0117.png","subbg_0118.png","subbg_0119.png","subbg_0120.png","subbg_0121.png","subbg_0122.png","subbg_0123.png","subbg_0124.png","subbg_0125.png","subbg_0126.png","subbg_0127.png","subbg_0128.png","subbg_0129.png","subbg_0130.png","subbg_0131.png","subbg_0132.png","subbg_0133.png","subbg_0134.png","subbg_0135.png","subbg_0136.png","subbg_0137.png","subbg_0138.png","subbg_0139.png","subbg_0140.png","subbg_0141.png","subbg_0142.png","subbg_0143.png","subbg_0144.png","subbg_0145.png","subbg_0146.png","subbg_0147.png","subbg_0148.png","subbg_0149.png","subbg_0150.png","subbg_0151.png","submonitor_bg.ifs"]}
+18
View File
@@ -1,6 +1,18 @@
//DATA// //DATA//
profile: DB.FindOne(refid, { collection: 'profile' }) profile: DB.FindOne(refid, { collection: 'profile' })
items_crew: DB.Find(refid, {$or:[{collection:"item",type:11,id:117}, {collection:"item",type:11,id:119}, {collection:"item",type:11,id:120}, {collection:"item",type:11,id:121}, {collection:"item",type:11,id:124}, {collection:"item",type:11,id:129}]})
items_stamp: DB.Find(refid, { collection:"item",type:17 })
items_subbg: DB.Find(refid, { collection:"item",type:18 })
items_bgm: DB.Find(refid, { collection:"item",type:19 })
items_nemsys: DB.Find(refid, { collection:"item",type:20 })
unlock_all: U.GetConfig('unlock_all_valk_items')
- -
const padded = _.padStart(profile.id.toString(), 8); const padded = _.padStart(profile.id.toString(), 8);
const sdvxid = `${padded.slice(0, 4)}-${padded.slice(4)}`; const sdvxid = `${padded.slice(0, 4)}-${padded.slice(4)}`;
@@ -160,4 +172,10 @@ div
.tild.is-child .tild.is-child
a(href="static/asset/nemsys/custom_nemsys.xml" download="custom_nemsys.xml") custom_nemsys.xml download a(href="static/asset/nemsys/custom_nemsys.xml" download="custom_nemsys.xml") custom_nemsys.xml download
div(hidden id='data-pass') !{JSON.stringify(profile)} div(hidden id='data-pass') !{JSON.stringify(profile)}
div(hidden id='data-pass-crew') !{JSON.stringify(items_crew)}
div(hidden id='data-pass-stamp') !{JSON.stringify(items_stamp)}
div(hidden id='data-pass-subbg') !{JSON.stringify(items_subbg)}
div(hidden id='data-pass-bgm') !{JSON.stringify(items_bgm)}
div(hidden id='data-pass-nemsys') !{JSON.stringify(items_nemsys)}
div(hidden id='data-pass-unlock-all') !{unlock_all}
script(src="static/asset/js/preview.js") script(src="static/asset/js/preview.js")
+1
View File
@@ -20,6 +20,7 @@ div
th ID th ID
th Song Name th Song Name
th Difficulty th Difficulty
th Date Released
th Score th Score
th Exscore th Exscore
th Grade th Grade
@@ -0,0 +1,80 @@
-
link(rel="stylesheet" href="static/asset/css/datatables.css")
div
.card
.card-header
p.card-header-title
span.icon
i.mdi.mdi-account-edit
| Skill Analyzer Settings (WIP)
.card-content
div
div
p(style="display:inline") Select Game:
|
|
select(id='sdvx-version')
option() -- Select --
option(value='4') IV - Heavenly Haven
option(value='5') V - Vivid Wave
option(value='6') VI - Exceed Gear
// input(id='add-skill-level-input')
// button(id='add-skill-level-btn') +
div
p(style="display:inline") Skill course:
|
|
select(id='skill-course')
option() -- Select --
|
|
select(id='skill-course-level')
option() -- Select --
div
each val in [1, 2, 3]
br
p(style="display:inline") Track ##{val}:
|
|
|
input(class='track-id' maxlength="4" size="4" onkeyup="this.value = this.value.replace(/[^0-9]+/, '')")
|
|
|
input(class='track-name')
|
|
|
select(class='track-difficulty')
option() -- Select --
br
br
button(id='savebutton') Save
br
br
div
.card
.card-header
p.card-header-title
span.icon
i.mdi.mdi-account-edit
| Songs List
.card-content
table.table(id="songslist" style="width:100%")
thead
tr
th ID
th Song Name
th Release Date
th Novice
th Advanced
th Exhaust
th Maximum
th Other
tbody
script(src="static/asset/js/skillanalyzer.js")
script(src="static/asset/js/datatables.js")
script(src="static/asset/js/songslist.js")
+26
View File
@@ -0,0 +1,26 @@
-
link(rel="stylesheet" href="static/asset/css/datatables.css")
div
.card
.card-header
p.card-header-title
span.icon
i.mdi.mdi-account-edit
| Songs List
.card-content
table.table(id="songslist" style="width:100%")
thead
tr
th ID
th Song Name
th Release Date
th Novice
th Advanced
th Exhaust
th Maximum
th Other
tbody
//div(hidden id='data-pass') !{JSON.stringify(profile)}
script(src="static/asset/js/songslist.js")
script(src="static/asset/js/datatables.js")
Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 873 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 901 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB