mdx-240613 (experimental)

This commit is contained in:
vvo
2024-06-20 16:24:27 +08:00
parent 87dab94b48
commit c9c59e0872
5 changed files with 678 additions and 16 deletions
+29 -10
View File
@@ -1,18 +1,37 @@
# Dance Dance Revolution
# DanceDanceRevolution
![Version](https://img.shields.io/badge/Version-v1.0.0-brightgreen?style=for-the-badge)
**Plugin Version:** fork-mdx-3.0.0
---
**Supported game versions:** WORLD (2024061300)
Supported version
**Unsupported game versions:** Everything below A20 is unsupported. A20 untested. A3 unsupported.
- Dance Dance Revolution A20
- Dance Dance Revolution A
**Required Asphyxia Core version** [1.50c](https://github.com/asphyxia-core/asphyxia-core.github.io/releases/tag/v1.50)
---
**Notes:**
- This is a highly experimental messily-written plugin for MDX-2024061300 and things **WILL** break, please do not use any of your personal save data on this plugin. Use this for experimental & development purposes only. I am not responsible for any problems with your savedata.
- Please be aware that this plugin and the savefile it produces are incompatible with the official plugin, or any other forks. Please be cautious of using other plugins' savefiles with this fork of the plugin, or using this fork's savefile with other plugins.
- Please back up your save data to prevent unwanted issues, especially while using this experimental plugin.
- Please please please feel free to open PRs!
Changelogs
**v1.0.0**
Changelog
===========
## fork-mdx-3.0.0
- Initial release
### New:
1. Main:
- 2024061300 support (DDR World)
- DDR profile registration for new and existing Asphyxia profiles
- For Asphyxia profiles with no prior DDR A20/A3 profiles registered.
- Transfer from A3 not supported (yet?)
- Profile saving and loading (probably incomplete)
- Score saving and loading (probably incomplete)
### To do:
1. Make songs appear
2. Look for more missing features (I don't play DDR so idk what's missing lol)
3. Check bugs (on score loading, profile saving, etc.)
4. Transfer old save data to World (?)
+492
View File
@@ -0,0 +1,492 @@
import { Profile } from "../models/profile";
import { ProfileWorld, ScoreWorld } from "../models/ddrworld";
export const playerdatanew: EPR = async (info, data, send) => {
const refid = $(data).str("data.refid");
console.log('playerdatanew')
console.log("----------------------")
let ddrCode = _.random(1, 99999999)
await DB.Upsert<ProfileWorld>(refid, { collection: "profile3" }, {
collection: "profile3",
ddrCode: ddrCode
})
return send.object({
result: K.ITEM("s32", 0),
refid: K.ITEM("str", refid),
ddrcode: K.ITEM("s32", ddrCode),
istakeover: K.ITEM('bool', false)
})
}
export const playerdatasave: EPR = async (info, data, send) => {
const refid = $(data).str("data.refid");
console.log('playerdatasave')
console.log(JSON.stringify($(info)))
console.log(JSON.stringify($(data)))
if(!refid.startsWith("X000")) {
if($(data).number("data.savekind") === 1) {
await DB.Upsert<ProfileWorld>(refid, { collection: "profile3" }, {
collection: "profile3",
ddrCode: $(data).number('data.common.ddrcode'),
dancerName: $(data).str('data.common.dancername'),
area: $(data).number('data.common.area'),
extraStar: $(data).number('data.common.extrastar'),
playCount: 0,
weight: 0,
todayCal: $(data).number('data.common.today_cal'),
isDispWeight: true,
prePlayableNum: 0,
opHispeed: $(data).number('data.option.hispeed'),
opGauge: $(data).number('data.option.gauge'),
opFastSlow: $(data).number('data.option.fastslow'),
opGuideline: $(data).number('data.option.guideline'),
opStepZone: $(data).number('data.option.stepzone'),
opTimingDisp: $(data).number('data.option.timing_disp'),
opVisibility: $(data).number('data.option.visibility'),
opVisibleTime: $(data).number('data.option.visible_time'),
opLane: $(data).number('data.option.lane'),
opLaneHiddenPos: $(data).number('data.option.lane_hiddenpos'),
opLaneSuddenPos: $(data).number('data.option.lane_suddenpos'),
opLaneHidSudPos: $(data).number('data.option.lane_hidsudpos'),
opLaneFilter: $(data).number('data.option.lane_filter'),
opScrollDirection: $(data).number('data.option.scroll_direction'),
opScrollMoving: $(data).number('data.option.scroll_moving'),
opArrowPriority: $(data).number('data.option.arrow_priority'),
opArrowPlacement: $(data).number('data.option.arrow_placement'),
opArrowColor: $(data).number('data.option.arrow_color'),
opArrowDesign: $(data).number('data.option.arrow_design'),
opCutTiming: $(data).number('data.option.cut_timing'),
opCutFreeze: $(data).number('data.option.cut_freeze'),
opCutJump: $(data).number('data.option.cut_jump'),
lpMode: $(data).number('data.lastplay.mode'),
lpFolder: $(data).number('data.lastplay.folder'),
lpMcode: $(data).number('data.lastplay.mcode'),
lpStyle: $(data).number('data.lastplay.style'),
lpDifficulty: $(data).number('data.lastplay.difficulty'),
lpWindowMain: $(data).number('data.lastplay.window_main'),
lpWindowSub: $(data).number('data.lastplay.window_sub'),
lpTarget: $(data).number('data.lastplay.target'),
lpTabMain: $(data).number('data.lastplay.tab_main'),
lpTabSub: $(data).number('data.lastplay.tab_sub'),
fsTitle: $(data).number('data.filtersort.title'),
fsVersion: $(data).number('data.filtersort.version'),
fsGenre: $(data).number('data.filtersort.genre'),
fsBpm: $(data).number('data.filtersort.bpm'),
fsEvent: $(data).number('data.filtersort.event'),
fsLevel: $(data).number('data.filtersort.level'),
fsFlareRank: $(data).number('data.filtersort.flare_rank'),
fsClearRank: $(data).number('data.filtersort.clear_rank'),
fsFlareSkillTarget: $(data).number('data.filtersort.flare_skill_target'),
fsRivalFlareSkill: $(data).number('data.filtersort.rival_flare_skill'),
fsRivalScoreRank: $(data).number('data.filtersort.rival_score_rank'),
fsSortType: $(data).number('data.filtersort.sort_type'),
fsOrderType: $(data).number('data.filtersort.order_type'),
cgTipsBasic: $(data).number('data.checkguide.tips_basic'),
cgTipsOption: $(data).number('data.checkguide.tips_option'),
cgTipsEvent: $(data).number('data.checkguide.tips_event'),
cgTipsGimmick: $(data).number('data.checkguide.tips_gimmick'),
cgTipsAdvance: $(data).number('data.checkguide.tips_advance'),
cgGuideScene: $(data).number('data.checkguide.guide_scene')
})
}
else if($(data).number("data.savekind") === 3) {
let profile = await DB.FindOne<ProfileWorld>(refid, {collection: "profile3"})
await DB.Upsert<ProfileWorld>(refid, { collection: "profile3" }, {
collection: "profile3",
ddrCode: $(data).number('data.common.ddrcode'),
dancerName: $(data).str('data.common.dancername'),
area: $(data).number('data.common.area'),
extraStar: $(data).number('data.common.extrastar'),
playCount: profile.playCount += 1,
weight: 0,
todayCal: $(data).number('data.common.today_cal'),
isDispWeight: true,
prePlayableNum: 0,
opHispeed: $(data).number('data.option.hispeed'),
opGauge: $(data).number('data.option.gauge'),
opFastSlow: $(data).number('data.option.fastslow'),
opGuideline: $(data).number('data.option.guideline'),
opStepZone: $(data).number('data.option.stepzone'),
opTimingDisp: $(data).number('data.option.timing_disp'),
opVisibility: $(data).number('data.option.visibility'),
opVisibleTime: $(data).number('data.option.visible_time'),
opLane: $(data).number('data.option.lane'),
opLaneHiddenPos: $(data).number('data.option.lane_hiddenpos'),
opLaneSuddenPos: $(data).number('data.option.lane_suddenpos'),
opLaneHidSudPos: $(data).number('data.option.lane_hidsudpos'),
opLaneFilter: $(data).number('data.option.lane_filter'),
opScrollDirection: $(data).number('data.option.scroll_direction'),
opScrollMoving: $(data).number('data.option.scroll_moving'),
opArrowPriority: $(data).number('data.option.arrow_priority'),
opArrowPlacement: $(data).number('data.option.arrow_placement'),
opArrowColor: $(data).number('data.option.arrow_color'),
opArrowDesign: $(data).number('data.option.arrow_design'),
opCutTiming: $(data).number('data.option.cut_timing'),
opCutFreeze: $(data).number('data.option.cut_freeze'),
opCutJump: $(data).number('data.option.cut_jump'),
lpMode: $(data).number('data.lastplay.mode'),
lpFolder: $(data).number('data.lastplay.folder'),
lpMcode: $(data).number('data.lastplay.mcode'),
lpStyle: $(data).number('data.lastplay.style'),
lpDifficulty: $(data).number('data.lastplay.difficulty'),
lpWindowMain: $(data).number('data.lastplay.window_main'),
lpWindowSub: $(data).number('data.lastplay.window_sub'),
lpTarget: $(data).number('data.lastplay.target'),
lpTabMain: $(data).number('data.lastplay.tab_main'),
lpTabSub: $(data).number('data.lastplay.tab_sub'),
fsTitle: $(data).number('data.filtersort.title'),
fsVersion: $(data).number('data.filtersort.version'),
fsGenre: $(data).number('data.filtersort.genre'),
fsBpm: $(data).number('data.filtersort.bpm'),
fsEvent: $(data).number('data.filtersort.event'),
fsLevel: $(data).number('data.filtersort.level'),
fsFlareRank: $(data).number('data.filtersort.flare_rank'),
fsClearRank: $(data).number('data.filtersort.clear_rank'),
fsFlareSkillTarget: $(data).number('data.filtersort.flare_skill_target'),
fsRivalFlareSkill: $(data).number('data.filtersort.rival_flare_skill'),
fsRivalScoreRank: $(data).number('data.filtersort.rival_score_rank'),
fsSortType: $(data).number('data.filtersort.sort_type'),
fsOrderType: $(data).number('data.filtersort.order_type'),
cgTipsBasic: $(data).number('data.checkguide.tips_basic'),
cgTipsOption: $(data).number('data.checkguide.tips_option'),
cgTipsEvent: $(data).number('data.checkguide.tips_event'),
cgTipsGimmick: $(data).number('data.checkguide.tips_gimmick'),
cgTipsAdvance: $(data).number('data.checkguide.tips_advance'),
cgGuideScene: $(data).number('data.checkguide.guide_scene')
})
let scores = $(data).elements('data.result')
for(const scoreData of scores) {
const songId = scoreData.number("mcode");
const style = scoreData.number("style");
const difficulty = scoreData.number("difficulty");
let rank = scoreData.number("rank");
let clearKind = scoreData.number("clearkind");
let score = scoreData.number("score");
let exScore = scoreData.number("exscore");
let maxCombo = scoreData.number("maxcombo");
let flareForce = scoreData.number("flare_force");
let ghostSize = scoreData.number("ghostsize");
let ghost = scoreData.str("ghost");
let stepScore = await DB.Find<ScoreWorld>(refid, {collection: "score3", songId: songId, style: style, difficulty: difficulty})
if(stepScore.length > 0) {
rank = (scoreData.number("rank") < stepScore[0].rank) ? scoreData.number("rank") : stepScore[0].rank;
clearKind = (scoreData.number("clearkind") != 6 && scoreData.number("clearkind") > stepScore[0].clearKind) ? scoreData.number("clearkind") : stepScore[0].clearKind;
score = (scoreData.number("score") > stepScore[0].score) ? scoreData.number("score") : stepScore[0].score;
exScore = (scoreData.number("exscore") > stepScore[0].exScore) ? scoreData.number("exscore") : stepScore[0].exScore;
maxCombo = (scoreData.number("maxcombo") > stepScore[0].maxCombo) ? scoreData.number("maxcombo") : stepScore[0].maxCombo;
flareForce = (scoreData.number("flare_force") > stepScore[0].flareForce) ? scoreData.number("flare_force") : stepScore[0].flareForce;
}
await DB.Upsert<ScoreWorld>(refid, {
collection: "score3",
songId,
style,
difficulty
}, {
$set: {
rank,
clearKind,
score,
exScore,
maxCombo,
flareForce
}
});
}
}
return send.object({
result: K.ITEM('s32', 0)
})
}
return send.object({
result: K.ITEM('s32', 1)
})
};
export const playerdataload: EPR = async (info, data, send) => {
const refid = $(data).str("data.refid");
console.log('playerdataload')
console.log("----------------------")
if (!refid.startsWith("X000")) {
const profile_a3 = await DB.FindOne<Profile>(refid, { collection: "profile" });
const profile = await DB.FindOne<ProfileWorld>(refid, { collection: "profile3" });
const scores = await DB.Find<ScoreWorld>(refid, { collection: "score3" });
let scoreFin = []
if(scores) {
for(const scoreData of scores) {
let mcodeIndex = scoreFin.findIndex(x => $(x).number('mcode') === scoreData.songId)
if(mcodeIndex < 0) {
let scr = {}
scr['mcode'] = K.ITEM('s32', scoreData.songId)
scr['score_single'] = []
scr['score_double'] = []
/*
difficulty,idk,grade,clearkind,score,idk either,flaredisp,flarepoints
*/
scr[(scoreData.style === 0) ? 'score_single' : 'score_double'] = [
{
score_str: K.ITEM('str', scoreData.difficulty + ',1,' + scoreData.rank + ',' + scoreData.clearKind + ',' + scoreData.score + ',' + scoreData.maxCombo + ',' + scoreData.flareForce + ',' + scoreData.flareForce)
}
]
scoreFin.push(scr)
} else {
scoreFin[mcodeIndex][(scoreData.style === 0) ? 'score_single' : 'score_double'].push({
score_str: K.ITEM('str', scoreData.difficulty + ',1,' + scoreData.rank + ',' + scoreData.clearKind + ',' + scoreData.score + ',' + scoreData.maxCombo + ',' + scoreData.flareForce + ',' + scoreData.flareForce)
})
}
}
}
if(!profile) {
if(profile_a3) {
return send.object({
result: K.ITEM("s32", 0),
refid: K.ITEM("str", refid),
gamesession: K.ITEM('s64', BigInt(1)),
servertime: K.ITEM("u64", BigInt(getDate())),
is_locked: K.ITEM('bool', false),
common: {
is_takeover: K.ITEM('bool', true)
}
})
}
return send.object({
result: K.ITEM("s32", 0),
refid: K.ITEM("str", refid),
gamesession: K.ITEM('s64', BigInt(1)),
servertime: K.ITEM("u64", BigInt(getDate())),
is_locked: K.ITEM('bool', false),
common: {
ddrcode: K.ITEM("s32", 0),
dancername: K.ITEM("str", ''),
is_new: K.ITEM('bool', true),
is_registering: K.ITEM('bool', false),
area: K.ITEM("s32", 0),
extrastar: K.ITEM("s32", 0),
playcount: K.ITEM("s32", 0),
weight: K.ITEM("s32", 0),
today_cal: K.ITEM("u64", BigInt(0)),
is_disp_weight: K.ITEM("bool", false),
is_takeover: K.ITEM('bool', false),
pre_playable_num: K.ITEM("s32", 0)
},
option: {
hispeed: K.ITEM("s32", 0),
gauge: K.ITEM("s32", 0),
fastslow: K.ITEM("s32", 0),
guideline: K.ITEM("s32", 0),
stepzone: K.ITEM("s32", 0),
timing_disp: K.ITEM("s32", 0),
visibility: K.ITEM("s32", 0),
visible_time: K.ITEM("s32", 0),
lane: K.ITEM("s32", 0),
lane_hiddenpos: K.ITEM("s32", 0),
lane_suddenpos: K.ITEM("s32", 0),
lane_hidsudpos: K.ITEM("s32", 0),
lane_filter: K.ITEM("s32", 0),
scroll_direction: K.ITEM("s32", 0),
scroll_moving: K.ITEM("s32", 0),
arrow_priority: K.ITEM("s32", 0),
arrow_placement: K.ITEM("s32", 0),
arrow_color: K.ITEM("s32", 0),
arrow_design: K.ITEM("s32", 0),
cut_timing: K.ITEM("s32", 0),
cut_freeze: K.ITEM("s32", 0),
cut_jump: K.ITEM("s32", 0)
},
lastplay: {
mode: K.ITEM("s32", 0),
folder: K.ITEM("s32", 0),
mcode: K.ITEM("s32", 0),
style: K.ITEM("s32", 0),
difficulty: K.ITEM("s32", 0),
window_main: K.ITEM("s32", 0),
window_sub: K.ITEM("s32", 0),
target: K.ITEM("s32", 0),
tab_main: K.ITEM("s32", 0),
tab_sub: K.ITEM("s32", 0)
},
filtersort: {
title: K.ITEM("u64", BigInt(0)),
version: K.ITEM("u64", BigInt(0)),
genre: K.ITEM("u64", BigInt(0)),
bpm: K.ITEM("u64", BigInt(0)),
event: K.ITEM("u64", BigInt(0)),
level: K.ITEM("u64", BigInt(0)),
flare_rank: K.ITEM("u64", BigInt(0)),
clear_rank: K.ITEM("u64", BigInt(0)),
flare_skill_target: K.ITEM("u64", BigInt(0)),
rival_flare_skill: K.ITEM("u64", BigInt(0)),
rival_score_rank: K.ITEM("u64", BigInt(0)),
sort_type: K.ITEM("u64", BigInt(0)),
order_type: K.ITEM("s32", 0),
},
checkguide: {
tips_basic: K.ITEM("u64", BigInt(0)),
tips_option: K.ITEM("u64", BigInt(0)),
tips_event: K.ITEM("u64", BigInt(0)),
tips_gimmick: K.ITEM("u64", BigInt(0)),
tips_advance: K.ITEM("u64", BigInt(0)),
guide_scene: K.ITEM("u64", BigInt(0)),
},
rival: [
{
slot: K.ITEM("s32", 0),
rivalcode: K.ITEM("s32", 0)
}
],
score: [
{
mcode: K.ITEM("s32", 0),
score_single: {
score_str: K.ITEM("str", "")
},
score_double: {
score_str: K.ITEM("str", "")
}
}
],
event: {
event_str: K.ITEM("str", "")
}
})
}
return send.object({
result: K.ITEM("s32", 0),
refid: K.ITEM("str", refid),
gamesession: K.ITEM('s64', BigInt(1)),
servertime: K.ITEM("u64", BigInt(getDate())),
is_locked: K.ITEM('bool', false),
common: {
ddrcode: K.ITEM("s32", profile.ddrCode),
dancername: K.ITEM("str", profile.dancerName),
is_new: K.ITEM('bool', false),
is_registering: K.ITEM('bool', false),
is_takeover: K.ITEM('bool', false),
area: K.ITEM("s32", profile.area),
extrastar: K.ITEM("s32", profile.extraStar),
playcount: K.ITEM("s32", profile.playCount),
weight: K.ITEM("s32", profile.weight),
today_cal: K.ITEM("u64", BigInt(profile.todayCal)),
is_disp_weight: K.ITEM("bool", profile.isDispWeight),
pre_playable_num: K.ITEM("s32", profile.prePlayableNum)
},
option: {
hispeed: K.ITEM("s32", profile.opHispeed),
gauge: K.ITEM("s32", profile.opGauge),
fastslow: K.ITEM("s32", profile.opFastSlow),
guideline: K.ITEM("s32", profile.opGuideline),
stepzone: K.ITEM("s32", profile.opStepZone),
timing_disp: K.ITEM("s32", profile.opTimingDisp),
visibility: K.ITEM("s32", profile.opVisibility),
visible_time: K.ITEM("s32", profile.opVisibleTime),
lane: K.ITEM("s32", profile.opLane),
lane_hiddenpos: K.ITEM("s32", profile.opLaneHiddenPos),
lane_suddenpos: K.ITEM("s32", profile.opLaneSuddenPos),
lane_hidsudpos: K.ITEM("s32", profile.opLaneHidSudPos),
lane_filter: K.ITEM("s32", profile.opLaneFilter),
scroll_direction: K.ITEM("s32", profile.opScrollDirection),
scroll_moving: K.ITEM("s32", profile.opScrollMoving),
arrow_priority: K.ITEM("s32", profile.opArrowPriority),
arrow_placement: K.ITEM("s32", profile.opArrowPlacement),
arrow_color: K.ITEM("s32", profile.opArrowColor),
arrow_design: K.ITEM("s32", profile.opArrowDesign),
cut_timing: K.ITEM("s32", profile.opCutTiming),
cut_freeze: K.ITEM("s32", profile.opCutFreeze),
cut_jump: K.ITEM("s32", profile.opCutJump)
},
lastplay: {
mode: K.ITEM("s32", profile.lpMode),
folder: K.ITEM("s32", profile.lpFolder),
mcode: K.ITEM("s32", profile.lpMcode),
style: K.ITEM("s32", profile.lpStyle),
difficulty: K.ITEM("s32", profile.lpDifficulty),
window_main: K.ITEM("s32", profile.lpWindowMain),
window_sub: K.ITEM("s32", profile.lpWindowSub),
target: K.ITEM("s32", profile.lpTarget),
tab_main: K.ITEM("s32", profile.lpTabMain),
tab_sub: K.ITEM("s32", profile.lpTabSub)
},
filtersort: {
title: K.ITEM("u64", BigInt(profile.fsTitle)),
version: K.ITEM("u64", BigInt(profile.fsVersion)),
genre: K.ITEM("u64", BigInt(profile.fsGenre)),
bpm: K.ITEM("u64", BigInt(profile.fsBpm)),
event: K.ITEM("u64", BigInt(profile.fsEvent)),
level: K.ITEM("u64", BigInt(profile.fsLevel)),
flare_rank: K.ITEM("u64", BigInt(profile.fsFlareRank)),
clear_rank: K.ITEM("u64", BigInt(profile.fsClearRank)),
flare_skill_target: K.ITEM("u64", BigInt(profile.fsFlareSkillTarget)),
rival_flare_skill: K.ITEM("u64", BigInt(profile.fsRivalFlareSkill)),
rival_score_rank: K.ITEM("u64", BigInt(profile.fsRivalScoreRank)),
sort_type: K.ITEM("u64", BigInt(profile.fsSortType)),
order_type: K.ITEM("s32", profile.fsOrderType),
},
checkguide: {
tips_basic: K.ITEM("u64", BigInt(profile.cgTipsBasic)),
tips_option: K.ITEM("u64", BigInt(profile.cgTipsOption)),
tips_event: K.ITEM("u64", BigInt(profile.cgTipsEvent)),
tips_gimmick: K.ITEM("u64", BigInt(profile.cgTipsGimmick)),
tips_advance: K.ITEM("u64", BigInt(profile.cgTipsAdvance)),
guide_scene: K.ITEM("u64", BigInt(profile.cgGuideScene)),
},
rival: [],
score: scoreFin,
event: []
});
}
return send.object({
result: K.ITEM("s32", 0),
is_new: K.ITEM("bool", false)
})
};
export const musicdataload: EPR = async (info, data, send) => {
console.log('musicdataload')
console.log("----------------------")
let musicList = []
return send.object({
result: K.ITEM("s32", 0),
servertime: K.ITEM("u64", BigInt(getDate())),
music: musicList
});
};
export const rivaldataload: EPR = async (info, data, send) => {
console.log('rivaldataload')
console.log("----------------------")
return send.deny();
};
export const taboowordcheck: EPR = async (info, data, send) => {
// Automatically accept word
return send.object({
result: K.ITEM("s32", 0),
is_taboo: K.ITEM("bool", false)
});
};
function getDate(): BigInt {
let time = new Date();
let tempDate = time.getDate();
const currentTime = parseInt((time.getTime()/100000) as unknown as string)*100;
return BigInt(currentTime)
}
+39 -5
View File
@@ -2,11 +2,14 @@ import { convcardnumber, eventLog } from "./handlers/common";
import { usergamedata } from "./handlers/usergamedata";
import { usergamedata_recv } from "./handlers/usergamedata_recv";
import { usergamedata_send } from "./handlers/usergamedata_send";
import { musicdataload, playerdatanew, playerdatasave, playerdataload, rivaldataload, taboowordcheck } from "./handlers/ddrworld";
import { CommonOffset, OptionOffset, Profile } from "./models/profile";
export function register() {
R.GameCode("MDX");
R.Unhandled(undefined);
R.Config("save_option", {
name: "Save option",
desc: "Gets the previously set options as they are.",
@@ -14,12 +17,43 @@ export function register() {
type: "boolean"
});
R.Route("playerdata.usergamedata_advanced", usergamedata);
R.Route("playerdata.usergamedata_recv", usergamedata_recv);
R.Route("playerdata.usergamedata_send", usergamedata_send);
const RoutePlayerData = (method: string, handler: EPR | boolean) => {
R.Route(`playerdata.${method}`, handler);
R.Route(`playerdata_2.${method}`, handler);
};
R.Route("system.convcardnumber", convcardnumber);
R.Route("eventlog.write", eventLog);
const RoutePlayData = (method: string, handler: EPR | boolean) => {
R.Route(`playdata_3.${method}`, handler);
};
const WordCheck = (method: string, handler: EPR | boolean) => {
R.Route(`wordcheck_3.${method}`, handler);
}
const RouteSystem = (method: string, handler: EPR | boolean) => {
R.Route(`system.${method}`, handler);
R.Route(`system_2.${method}`, handler);
R.Route(`system_3.${method}`, handler);
};
const RouteEventLog = (method: string, handler: EPR | boolean) => {
R.Route(`eventlog.${method}`, handler);
R.Route(`eventlog_2.${method}`, handler);
R.Route(`eventlog_3.${method}`, handler);
};
RoutePlayerData('usergamedata_advanced', usergamedata);
RoutePlayerData('usergamedata_recv', usergamedata_recv);
RoutePlayerData('usergamedata_send', usergamedata_send);
RoutePlayData('musicdata_load', musicdataload);
RoutePlayData('playerdata_new', playerdatanew);
RoutePlayData('playerdata_load', playerdataload);
RoutePlayData('playerdata_save', playerdatasave);
RoutePlayData('rivaldata_load', rivaldataload);
RouteSystem("convcardnumber", convcardnumber);
RouteEventLog("write", eventLog);
WordCheck('tabooword_check', taboowordcheck)
R.WebUIEvent("updateName", async ({ refid, name }) => {
let strdata: Profile | string[] = await DB.FindOne<Profile>(refid, { collection: "profile" });
+117
View File
@@ -0,0 +1,117 @@
import { Difficulty, Rank, ClearKind } from '../models/score'
export interface RivalWorld {
collection: "rival3";
slot: number;
rivalCode: number;
}
export interface ScoreWorld {
collection: "score3";
songId: number;
style: number;
difficulty: Difficulty;
rank: Rank;
clearKind: ClearKind;
score: number;
exScore: number;
maxCombo: number;
flareForce: number;
}
export interface ProfileWorld {
collection: "profile3";
ddrCode: number;
dancerName: string;
area: number;
extraStar: number;
playCount: number;
weight: number;
todayCal: number;
isDispWeight: boolean;
prePlayableNum: number;
opHispeed: number;
opGauge: number;
opFastSlow: number;
opGuideline: number;
opStepZone: number;
opTimingDisp: number;
opVisibility: number;
opVisibleTime: number;
opLane: number;
opLaneHiddenPos: number;
opLaneSuddenPos: number;
opLaneHidSudPos: number;
opLaneFilter: number;
opScrollDirection: number;
opScrollMoving: number;
opArrowPriority: number;
opArrowPlacement: number;
opArrowColor: number;
opArrowDesign: number;
opCutTiming: number;
opCutFreeze: number;
opCutJump: number;
lpMode: number;
lpFolder: number;
lpMcode: number;
lpStyle: number;
lpDifficulty: number;
lpWindowMain: number;
lpWindowSub: number;
lpTarget: number;
lpTabMain: number;
lpTabSub: number;
fsTitle: number;
fsVersion: number;
fsGenre: number;
fsBpm: number;
fsEvent: number;
fsLevel: number;
fsFlareRank: number;
fsClearRank: number;
fsFlareSkillTarget: number;
fsRivalFlareSkill: number;
fsRivalScoreRank: number;
fsSortType: number;
fsOrderType: number;
cgTipsBasic: number;
cgTipsOption: number;
cgTipsEvent: number;
cgTipsGimmick: number;
cgTipsAdvance: number;
cgGuideScene: number;
singleGrade?: number;
doubleGrade?: number;
events?: {};
usergamedata?: {
COMMON?: {
strdata?: string;
bindata?: string;
};
OPTION?: {
strdata?: string;
bindata?: string;
};
LAST?: {
strdata?: string;
bindata?: string;
};
RIVAL?: {
strdata?: string;
bindata?: string;
};
};
}
+1 -1
View File
@@ -33,7 +33,7 @@ export enum ClearKind {
NONE = 6,
GOOD_COMBO,
GREAT_COMBO,
PERPECT_COMBO,
PERFECT_COMBO,
MARVELOUS_COMBO
}