IIDX: Exposed more pc.common/gameSystem.systemInfo attributes to plugin settings - 2

This commit is contained in:
duel0213 2024-02-19 04:14:33 +09:00
parent 28538c17dd
commit c180ee208f
5 changed files with 181 additions and 72 deletions

View File

@ -105,4 +105,5 @@ Changelogs
- Exposed some of pc.common attributes to plugin settings (WIP)
- Added Experimental WebUI (WIP)
- Added music.crate/music.breg response
- Fixed Venue Top didn't save correctly (BISTROVER ~)
- Fixed where Venue Top didn't save correctly (BISTROVER ~)
- Fixed where music.appoint send empty response even rival has score data when player doesn't have score data

View File

@ -7,7 +7,7 @@ export const gssysteminfo: EPR = async (info, data, send) => {
let result: any = {
arena_schedule: {
phase: K.ITEM("u8", 2),
phase: K.ITEM("u8", U.GetConfig("ArenaPhase")),
start: K.ITEM("u32", 1605784800),
end: K.ITEM("u32", 4102326000)
},
@ -50,11 +50,11 @@ export const gssysteminfo: EPR = async (info, data, send) => {
result = {
...result,
CommonBossPhase: K.ATTR({ val: String(3) }),
Event1InternalPhase: K.ATTR({ val: String(5) }),
ExtraBossEventPhase: K.ATTR({ val: String(3) }),
isNewSongAnother12OpenFlg: K.ATTR({ val: String(1) }),
gradeOpenPhase: K.ATTR({ val: String(2) }),
isEiseiOpenFlg: K.ATTR({ val: String(1) }),
Event1InternalPhase: K.ATTR({ val: String(U.GetConfig("ch_event")) }),
ExtraBossEventPhase: K.ATTR({ val: String(U.GetConfig("ch_extraboss")) }),
isNewSongAnother12OpenFlg: K.ATTR({ val: String(Number(U.GetConfig("NewSongAnother12"))) }),
gradeOpenPhase: K.ATTR({ val: String(U.GetConfig("Grade")) }),
isEiseiOpenFlg: K.ATTR({ val: String(Number(U.GetConfig("Eisei"))) }),
WorldTourismOpenList: K.ATTR({ val: String(-1) }),
BPLBattleOpenPhase: K.ATTR({ val: String(2) }),
}
@ -63,11 +63,11 @@ export const gssysteminfo: EPR = async (info, data, send) => {
result = {
...result,
CommonBossPhase: K.ATTR({ val: String(3) }),
Event1InternalPhase: K.ATTR({ val: String(5) }),
ExtraBossEventPhase: K.ATTR({ val: String(3) }),
isNewSongAnother12OpenFlg: K.ATTR({ val: String(1) }),
gradeOpenPhase: K.ATTR({ val: String(2) }),
isEiseiOpenFlg: K.ATTR({ val: String(1) }),
Event1InternalPhase: K.ATTR({ val: String(U.GetConfig("rs_event")) }),
ExtraBossEventPhase: K.ATTR({ val: String(U.GetConfig("rs_extraboss")) }),
isNewSongAnother12OpenFlg: K.ATTR({ val: String(Number(U.GetConfig("NewSongAnother12"))) }),
gradeOpenPhase: K.ATTR({ val: String(U.GetConfig("Grade")) }),
isEiseiOpenFlg: K.ATTR({ val: String(Number(U.GetConfig("Eisei"))) }),
WorldTourismOpenList: K.ATTR({ val: String(-1) }),
BPLBattleOpenPhase: K.ATTR({ val: String(2) }),
}

View File

@ -170,18 +170,18 @@ export const musicappoint: EPR = async (info, data, send) => {
[clid]: { $exists: true },
});
if (_.isNil(music_data)) return send.success();
let mydata, option = 0, option2 = 0;
if (version >= 27) {
if (!_.isNil(music_data.optArray) && version > 27) {
option = music_data.optArray[clid];
option2 = music_data.opt2Array[clid];
}
if (!_.isNil(music_data)) {
if (version >= 27) {
if (!_.isNil(music_data.optArray) && version > 27) {
option = music_data.optArray[clid];
option2 = music_data.opt2Array[clid];
}
mydata = Base64toBuffer(music_data[clid]);
mydata = Base64toBuffer(music_data[clid]);
}
else mydata = K.ITEM("bin", Base64toBuffer(music_data[clid]));
}
else mydata = K.ITEM("bin", Base64toBuffer(music_data[clid]));
/*** ctype
[-1] - DEFAULT
@ -202,34 +202,35 @@ export const musicappoint: EPR = async (info, data, send) => {
// OTHERS //
let other_refid, other_musicdata: score | null, other_pcdata, other_profile, sdata = null;
switch (ctype) {
case 1:
if (_.isNaN(subtype)) break;
if (!_.isNaN(subtype)) {
switch (ctype) {
case 1:
other_refid = await IDtoRef(subtype);
other_profile = await ReftoProfile(other_refid);
other_pcdata = await ReftoPcdata(other_refid, version);
other_musicdata = await DB.FindOne<score>(other_refid, {
collection: "score",
mid: mid,
[clid]: { $exists: true },
});
if (_.isNaN(other_pcdata) || _.isNil(other_musicdata)) break;
other_refid = await IDtoRef(subtype);
other_profile = await ReftoProfile(other_refid);
other_pcdata = await ReftoPcdata(other_refid, version);
other_musicdata = await DB.FindOne<score>(other_refid, {
collection: "score",
mid: mid,
[clid]: { $exists: true },
});
if (_.isNaN(other_pcdata) || _.isNil(other_musicdata)) break;
sdata = K.ITEM("bin", Base64toBuffer(other_musicdata[clid]), {
score: String(other_musicdata.esArray[clid]),
pid: String(other_profile[1]),
name: String(other_profile[0]),
riidxid: String(other_profile[2])
});
break;
sdata = K.ITEM("bin", Base64toBuffer(other_musicdata[clid]), {
score: String(other_musicdata.esArray[clid]),
pid: String(other_profile[1]),
name: String(other_profile[0]),
riidxid: String(other_profile[2])
});
break;
default:
break;
default:
break;
}
}
if (version >= 27) {
let my_gauge_data = Base64toBuffer(music_data[clid + 10]);
let my_gauge_data = null;
if (!_.isNil(music_data)) my_gauge_data = Base64toBuffer(music_data[clid + 10]);
if (!_.isNil(sdata)) {
if (_.isNil(other_musicdata.optArray)) { // temp //
@ -252,6 +253,14 @@ export const musicappoint: EPR = async (info, data, send) => {
gauge_data: K.ITEM("bin", Base64toBuffer(other_musicdata[clid + 10]))
};
if (_.isNil(mydata) && _.isNil(sdata)) return send.success();
if (_.isNil(mydata)) {
return send.object({
sdata,
});
}
return send.object({
"@attr": { my_option: option, my_option2: option2 }, // CastHour //
mydata: K.ITEM("bin", mydata),
@ -260,6 +269,8 @@ export const musicappoint: EPR = async (info, data, send) => {
});
}
if (_.isNil(mydata) && _.isNil(sdata)) return send.success();
return send.object({
"@attr": { my_option: option, my_option2: option2 }, // CastHour //
mydata: K.ITEM("bin", mydata),
@ -267,6 +278,8 @@ export const musicappoint: EPR = async (info, data, send) => {
});
}
if (_.isNil(mydata) && _.isNil(sdata)) return send.success();
if (!_.isNil(sdata)) {
return send.object({
mydata,

View File

@ -71,7 +71,7 @@ export const pccommon: EPR = async (info, data, send) => {
tricolettepark_skip: K.ATTR({ phase: String(U.GetConfig("sp_triparkskip")) }),
deller_bonus: K.ATTR({ open: String(1) }),
gumi_event: {},
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
superstar: K.ATTR({ phase: String(U.GetConfig("sp_superstar")) }),
}
break;
@ -88,7 +88,7 @@ export const pccommon: EPR = async (info, data, send) => {
cc_collabo_event: K.ATTR({ phase: String(U.GetConfig("pd_cccollabo")) }),
cc_collabo_license: {},
deller_bonus: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
common_timeshift_phase: K.ATTR({ phase: String(U.GetConfig("pd_timephase")) }),
expert_secret_full_open: {},
eappli_expert: {},
@ -105,7 +105,7 @@ export const pccommon: EPR = async (info, data, send) => {
vip_pass_black: {},
event1_ranbow_ticket: {},
deller_bonus: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
expert_secret_full_open: {},
remocon_collabo: {},
ravemania_collabo: {},
@ -120,7 +120,7 @@ export const pccommon: EPR = async (info, data, send) => {
case 26:
result = {
...result,
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
expert_secret_full_open: {},
system_voice_phase: K.ATTR({ phase: String(_.random(0, 8)) }),
}
@ -128,14 +128,14 @@ export const pccommon: EPR = async (info, data, send) => {
case 27:
result = {
...result,
boss: K.ATTR({ phase: String(1) }),
boss: K.ATTR({ phase: String(U.GetConfig("hv_boss")) }),
vip_pass_black: {},
deller_bonus: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
expert_secret_full_open: {},
system_voice_phase: K.ATTR({ phase: String(_.random(0, 8)) }),
extra_boss_event: K.ATTR({ phase: String(1) }),
event1_phase: K.ATTR({ phase: String(4) }),
extra_boss_event: K.ATTR({ phase: String(U.GetConfig("hv_extraboss")) }),
event1_phase: K.ATTR({ phase: String(U.GetConfig("hv_event")) }),
premium_area_news: K.ATTR({ open: String(1) }),
premium_area_qpro: K.ATTR({ open: String(1) }),
play_video: {},
@ -146,16 +146,16 @@ export const pccommon: EPR = async (info, data, send) => {
result = {
...result,
movie_agreement: K.ATTR({ version: String(1) }),
movie_upload: K.ATTR({ url: String(U.GetConfig("bo_movieupload")) }),
boss: K.ATTR({ phase: String(1) }),
movie_upload: K.ATTR({ url: String(U.GetConfig("MovieUpload")) }),
boss: K.ATTR({ phase: String(U.GetConfig("bo_boss")) }),
vip_pass_black: {},
eisei: K.ATTR({ open: String(1) }),
eisei: K.ATTR({ open: String(Number(U.GetConfig("Eisei"))) }),
deller_bonus: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
expert_secret_full_open: {},
system_voice_phase: K.ATTR({ phase: String(_.random(0, 8)) }),
extra_boss_event: K.ATTR({ phase: String(1) }),
event1_phase: K.ATTR({ phase: String(4) }),
extra_boss_event: K.ATTR({ phase: String(U.GetConfig("bo_extraboss")) }),
event1_phase: K.ATTR({ phase: String(U.GetConfig("bo_event")) }),
premium_area_news: K.ATTR({ open: String(1) }),
premium_area_qpro: K.ATTR({ open: String(1) }),
play_video: {},
@ -168,16 +168,16 @@ export const pccommon: EPR = async (info, data, send) => {
result = {
...result,
movie_agreement: K.ATTR({ version: String(1) }),
movie_upload: K.ATTR({ url: String(U.GetConfig("bo_movieupload")) }),
boss: K.ATTR({ phase: String(1) }),
movie_upload: K.ATTR({ url: String(U.GetConfig("MovieUpload")) }),
boss: K.ATTR({ phase: String(1) }), // TODO:: verify //
vip_pass_black: {},
eisei: K.ATTR({ open: String(1) }),
eisei: K.ATTR({ open: String(Number(U.GetConfig("Eisei"))) }), // TODO:: verify //
deller_bonus: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }), // TODO:: verify //
expert_secret_full_open: {},
system_voice_phase: K.ATTR({ phase: String(_.random(0, 8)) }),
extra_boss_event: K.ATTR({ phase: String(1) }),
event1_phase: K.ATTR({ phase: String(4) }),
extra_boss_event: K.ATTR({ phase: String(1) }), // TODO:: verify //
event1_phase: K.ATTR({ phase: String(4) }), // TODO:: verify //
premium_area_news: K.ATTR({ open: String(1) }),
premium_area_qpro: K.ATTR({ open: String(1) }),
play_video: {},
@ -191,10 +191,10 @@ export const pccommon: EPR = async (info, data, send) => {
result = {
...result,
movie_agreement: K.ATTR({ version: String(1) }),
movie_upload: K.ATTR({ url: String(U.GetConfig("bo_movieupload")) }),
movie_upload: K.ATTR({ url: String(U.GetConfig("MovieUpload")) }),
vip_pass_black: {},
deller_bonus: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(1) }),
newsong_another: K.ATTR({ open: String(Number(U.GetConfig("NewSongAnother12"))) }),
system_voice_phase: K.ATTR({ phase: String(_.random(0, 8)) }),
premium_area_news: K.ATTR({ open: String(1) }),
premium_area_qpro: K.ATTR({ open: String(1) }),

View File

@ -21,9 +21,18 @@ export function register() {
// common //
R.Config("BeatPhase", {
name: "Beat #",
desc: "1 / 2 / 3 / FREE",
type: "integer",
default: 3,
default: 3, // BEAT FREE //
});
// SPADA ~ (common) //
R.Config("NewSongAnother12", {
name: "New Song Another",
desc: "Enables ANOTHER difficulty of current version's new songs that has Level 12",
type: "boolean",
default: true,
});
// PENDUAL ~ (common) //
R.Config("ExpertPhase", {
name: "Expert Phase",
type: "integer",
@ -34,6 +43,32 @@ export function register() {
type: "integer",
default: 2,
});
// HEROIC VERSE ~ (common) //
R.Config("ArenaPhase", {
name: "ARENA Phase",
type: "integer",
default: 2, // ADVERTISE //
});
// BISTROVER ~ (common) //
R.Config("MovieUpload", {
name: "Movie Upload URL",
type: "string",
desc: "API address for play video uploading feature (JSON)",
default: "http://localhost/"
});
R.Config("Eisei", {
name: "Eisei Dan Courses",
desc: "Enable EISEI DAN Courses",
type: "boolean",
default: true,
});
// CastHour ~ RESIDENT (common) //
R.Config("Grade", {
name: "Grade Open Phase",
desc: "RED / KAIDEN",
type: "integer",
default: 2,
})
// Resort Anthem //
R.Config("ra_cmd_gmbl", {
@ -261,11 +296,71 @@ export function register() {
default: 2,
});
// BISTROVER ~ (common) //
R.Config("bo_movieupload", {
name: "Movie Upload URL",
type: "string",
default: "http://localhost/"
// HEROIC VERSE //
R.Config("hv_boss", {
name: "Event Phase (HV)",
desc: "HEROIC WORKOUT!!",
type: "integer",
default: 1,
});
R.Config("hv_event", {
name: "HEROIC WORKOUT!!",
desc: "HEROIC WORKOUT!! Phase",
type: "integer",
default: 4
});
R.Config("hv_extraboss",
{
name: "SHADOW REBELLION",
desc: "SHADOW REBELLION Phase",
type: "integer",
default: 1
});
// BISTROVER //
R.Config("bo_boss", {
name: "Event Phase (BO)",
desc: "召しませBISTROVER",
type: "integer",
default: 1
});
R.Config("bo_extraboss", {
name: "BISTRO LANDING",
desc: "BISTRO LANDING Phase",
type: "integer",
default: 1
});
R.Config("bo_event", {
name: "召しませBISTROVER",
desc: "召しませBISTROVER Phase",
type: "integer",
default: 1
});
// CastHour //
R.Config("ch_event", {
name: "CastHour Space",
desc: "CastHour Space Phase",
type: "integer",
default: 5,
});
R.Config("ch_extraboss", {
name: "Extra Boss Phase (CH)",
type: "integer",
default: 3,
});
// RESIDENT //
R.Config("rs_event", {
name: "RESIDENT PARTY",
desc: "RESIDENT PARTY Phase",
type: "integer",
default: 5,
});
R.Config("rs_extraboss", {
name: "Extra Boss Phase (RS)",
type: "integer",
default: 3,
});
// TODO:: Reflect data when version dropdown menu has been changed //