mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-09-22 22:27:56 +03:00
update
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import { Profile } from '../models/profile';
|
||||
import { VersionData } from '../models/version_data';
|
||||
import { SDVX_AUTOMATION_SONGS } from '../data/vvw';
|
||||
import { CourseRecord } from '../models/course_record';
|
||||
import { Item } from '../models/item';
|
||||
import { Param } from '../models/param';
|
||||
|
||||
export const loadScores: EPR = async (info, data, send) => {
|
||||
const refid = $(data).str('refid');
|
||||
@@ -8,6 +12,44 @@ export const loadScores: EPR = async (info, data, send) => {
|
||||
send.pugFile('templates/load_m.pug', { records });
|
||||
};
|
||||
|
||||
export const save: EPR = async (info, data, send) => {
|
||||
const refid = $(data).str('refid');
|
||||
|
||||
await DB.Update<Profile>(
|
||||
refid,
|
||||
{ collection: 'profile' },
|
||||
{
|
||||
$set: {
|
||||
appeal: $(data).number('appeal_id'),
|
||||
|
||||
musicID: $(data).number('music_id'),
|
||||
musicType: $(data).number('music_type'),
|
||||
sortType: $(data).number('sort_type'),
|
||||
headphone: $(data).number('headphone'),
|
||||
blasterCount: $(data).number('blaster_count'),
|
||||
|
||||
hiSpeed: $(data).number('hispeed'),
|
||||
laneSpeed: $(data).number('lanespeed'),
|
||||
gaugeOption: $(data).number('gauge_option'),
|
||||
arsOption: $(data).number('ars_option'),
|
||||
notesOption: $(data).number('notes_option'),
|
||||
earlyLateDisp: $(data).number('early_late_disp'),
|
||||
drawAdjust: $(data).number('draw_adjust'),
|
||||
effCLeft: $(data).number('eff_c_left'),
|
||||
effCRight: $(data).number('eff_c_right'),
|
||||
narrowDown: $(data).number('narrow_down'),
|
||||
},
|
||||
$inc: {
|
||||
packets: $(data).number('earned_gamecoin_packet'),
|
||||
blocks: $(data).number('earned_gamecoin_block'),
|
||||
blasterEnergy: $(data).number('earned_blaster_energy'),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
send.success();
|
||||
};
|
||||
|
||||
export const load: EPR = async (info, data, send) => {
|
||||
const refid = $(data).str('refid');
|
||||
|
||||
@@ -21,8 +63,16 @@ export const load: EPR = async (info, data, send) => {
|
||||
break;
|
||||
}
|
||||
|
||||
const profile = await DB.FindOne(refid, { collection: 'profile' });
|
||||
let versionData: VersionData = await DB.FindOne(refid, {
|
||||
const profile = await DB.FindOne<Profile>(refid, {
|
||||
collection: 'profile',
|
||||
});
|
||||
|
||||
if (!profile) {
|
||||
send.object({ result: K.ITEM('u8', 1) });
|
||||
return;
|
||||
}
|
||||
|
||||
let versionData = await DB.FindOne<VersionData>(refid, {
|
||||
collection: 'version',
|
||||
});
|
||||
|
||||
@@ -30,26 +80,22 @@ export const load: EPR = async (info, data, send) => {
|
||||
versionData = {
|
||||
collection: 'version',
|
||||
version,
|
||||
items: {},
|
||||
params: {},
|
||||
skill: {
|
||||
base: 0,
|
||||
level: 0,
|
||||
name: 0,
|
||||
},
|
||||
skillBase: 0,
|
||||
skillLevel: 0,
|
||||
skillName: 0,
|
||||
};
|
||||
await DB.Insert(refid, versionData);
|
||||
}
|
||||
|
||||
if (!profile) {
|
||||
send.object({ result: K.ITEM('u8', 1) });
|
||||
return;
|
||||
}
|
||||
|
||||
const courses = await DB.Find(refid, { collection: 'course' });
|
||||
const courses = await DB.Find<CourseRecord>(refid, { collection: 'course' });
|
||||
const items = await DB.Find<Item>(refid, { collection: 'item' });
|
||||
const params = await DB.Find<Param>(refid, { collection: 'param' });
|
||||
|
||||
send.pugFile('templates/load.pug', {
|
||||
courses,
|
||||
items,
|
||||
params,
|
||||
mixes: version == 5 ? SDVX_AUTOMATION_SONGS : [],
|
||||
...profile,
|
||||
...versionData,
|
||||
});
|
||||
@@ -66,30 +112,24 @@ export const create: EPR = async (info, data, send) => {
|
||||
name,
|
||||
appeal: 0,
|
||||
akaname: 0,
|
||||
currency: {
|
||||
blocks: 0,
|
||||
packets: 0,
|
||||
},
|
||||
settings: {
|
||||
arsOption: 0,
|
||||
drawAdjust: 0,
|
||||
earlyLateDisp: 0,
|
||||
effCLeft: 0,
|
||||
effCRight: 1,
|
||||
gaugeOption: 0,
|
||||
hiSpeed: 0,
|
||||
laneSpeed: 0,
|
||||
narrowDown: 0,
|
||||
notesOption: 0,
|
||||
},
|
||||
state: {
|
||||
blasterCount: 0,
|
||||
blasterEnergy: 0,
|
||||
headphone: 0,
|
||||
lastMusicID: 0,
|
||||
lastMusicType: 0,
|
||||
sortType: 0,
|
||||
},
|
||||
blocks: 0,
|
||||
packets: 0,
|
||||
arsOption: 0,
|
||||
drawAdjust: 0,
|
||||
earlyLateDisp: 0,
|
||||
effCLeft: 0,
|
||||
effCRight: 1,
|
||||
gaugeOption: 0,
|
||||
hiSpeed: 0,
|
||||
laneSpeed: 0,
|
||||
narrowDown: 0,
|
||||
notesOption: 0,
|
||||
blasterCount: 0,
|
||||
blasterEnergy: 0,
|
||||
headphone: 0,
|
||||
musicID: 0,
|
||||
musicType: 0,
|
||||
sortType: 0,
|
||||
};
|
||||
|
||||
await DB.Upsert(refid, { collection: 'profile' }, profile);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { common } from './handlers/common';
|
||||
import { load, create, loadScores } from './handlers/profile';
|
||||
import { load, create, loadScores, save } from './handlers/profile';
|
||||
export function register() {
|
||||
R.GameCode('KFC');
|
||||
|
||||
@@ -12,6 +12,8 @@ export function register() {
|
||||
R.Route('game.sv4_new', create);
|
||||
R.Route('game.sv4_frozen', true);
|
||||
R.Route('game.sv4_load_r', true);
|
||||
R.Route('game.sv4_save', save);
|
||||
R.Route('game.sv4_save_m', true);
|
||||
|
||||
R.Route('game.sv5_common', common);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface Item {
|
||||
collection: 'item';
|
||||
type: number;
|
||||
id: number;
|
||||
param: number;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface Param {
|
||||
collection: 'param';
|
||||
type: number;
|
||||
id: number;
|
||||
param: number[];
|
||||
}
|
||||
@@ -7,30 +7,24 @@ export interface Profile {
|
||||
appeal: number;
|
||||
akaname: number;
|
||||
|
||||
currency: {
|
||||
packets: number;
|
||||
blocks: number;
|
||||
};
|
||||
packets: number;
|
||||
blocks: number;
|
||||
|
||||
state: {
|
||||
lastMusicID: number;
|
||||
lastMusicType: number;
|
||||
sortType: number;
|
||||
headphone: number;
|
||||
blasterEnergy: number;
|
||||
blasterCount: number;
|
||||
};
|
||||
musicID: number;
|
||||
musicType: number;
|
||||
sortType: number;
|
||||
headphone: number;
|
||||
blasterEnergy: number;
|
||||
blasterCount: number;
|
||||
|
||||
settings: {
|
||||
hiSpeed: number;
|
||||
laneSpeed: number;
|
||||
gaugeOption: number;
|
||||
arsOption: number;
|
||||
notesOption: number;
|
||||
earlyLateDisp: number;
|
||||
drawAdjust: number;
|
||||
effCLeft: number;
|
||||
effCRight: number;
|
||||
narrowDown: number;
|
||||
};
|
||||
hiSpeed: number;
|
||||
laneSpeed: number;
|
||||
gaugeOption: number;
|
||||
arsOption: number;
|
||||
notesOption: number;
|
||||
earlyLateDisp: number;
|
||||
drawAdjust: number;
|
||||
effCLeft: number;
|
||||
effCRight: number;
|
||||
narrowDown: number;
|
||||
}
|
||||
|
||||
@@ -3,15 +3,8 @@ export interface VersionData {
|
||||
collection: 'version';
|
||||
|
||||
version: number;
|
||||
skill: {
|
||||
level: number;
|
||||
base: number;
|
||||
name: number;
|
||||
};
|
||||
items: {
|
||||
[key: string]: number;
|
||||
};
|
||||
params: {
|
||||
[key: string]: number[];
|
||||
};
|
||||
|
||||
skillLevel: number;
|
||||
skillBase: number;
|
||||
skillName: number;
|
||||
}
|
||||
|
||||
@@ -3,32 +3,32 @@ game
|
||||
name(__type="str") #{name}
|
||||
code(__type="str") 1337-6666
|
||||
sdvx_id(__type="str") 1337-6666
|
||||
gamecoin_packet(__type="u32") #{currency.packets}
|
||||
gamecoin_block(__type="u32") #{currency.blocks}
|
||||
gamecoin_packet(__type="u32") #{packets}
|
||||
gamecoin_block(__type="u32") #{blocks}
|
||||
appeal_id(__type="u16") #{appeal}
|
||||
|
||||
last_music_id(__type="s32") #{state.lastMusicID}
|
||||
last_music_type(__type="u8") #{state.lastMusicType}
|
||||
sort_type(__type="u8") #{state.sortType}
|
||||
headphone(__type="u8") #{state.headphone}
|
||||
blaster_energy(__type="u32") #{state.blasterEnergy}
|
||||
blaster_count(__type="u32") #{state.blasterCount}
|
||||
last_music_id(__type="s32") #{musicID}
|
||||
last_music_type(__type="u8") #{musicType}
|
||||
sort_type(__type="u8") #{sortType}
|
||||
headphone(__type="u8") #{headphone}
|
||||
blaster_energy(__type="u32") #{blasterEnergy}
|
||||
blaster_count(__type="u32") #{blasterCount}
|
||||
|
||||
hispeed(__type="s32") #{settings.hiSpeed}
|
||||
lanespeed(__type="u32") #{settings.laneSpeed}
|
||||
gauge_option(__type="u8") #{settings.gaugeOption}
|
||||
ars_option(__type="u8") #{settings.arsOption}
|
||||
notes_option(__type="u8") #{settings.notesOption}
|
||||
early_late_disp(__type="u8") #{settings.earlyLateDisp}
|
||||
draw_adjust(__type="s32") #{settings.drawAdjust}
|
||||
eff_c_left(__type="u8") #{settings.effCLeft}
|
||||
eff_c_right(__type="u8") #{settings.effCRight}
|
||||
narrow_down(__type="u8") #{settings.narrowDown}
|
||||
hispeed(__type="s32") #{hiSpeed}
|
||||
lanespeed(__type="u32") #{laneSpeed}
|
||||
gauge_option(__type="u8") #{gaugeOption}
|
||||
ars_option(__type="u8") #{arsOption}
|
||||
notes_option(__type="u8") #{notesOption}
|
||||
early_late_disp(__type="u8") #{earlyLateDisp}
|
||||
draw_adjust(__type="s32") #{drawAdjust}
|
||||
eff_c_left(__type="u8") #{effCLeft}
|
||||
eff_c_right(__type="u8") #{effCRight}
|
||||
narrow_down(__type="u8") #{narrowDown}
|
||||
|
||||
kac_id(__type="str") #{name}
|
||||
skill_level(__type="s16") #{skill.level}
|
||||
skill_base_id(__type="s16") #{skill.base}
|
||||
skill_name_id(__type="s16") #{skill.name}
|
||||
skill_level(__type="s16") #{skillLevel}
|
||||
skill_base_id(__type="s16") #{skillBase}
|
||||
skill_name_id(__type="s16") #{skillName}
|
||||
|
||||
ea_shop
|
||||
packet_booster(__type="s32") 1
|
||||
@@ -59,6 +59,13 @@ game
|
||||
id(__type="u32") #{item.id}
|
||||
param(__type="u32") #{item.param}
|
||||
|
||||
//- Unlock automation songs
|
||||
each song in mixes
|
||||
info
|
||||
type(__type="u8") 15
|
||||
id(__type="u32") #{song}
|
||||
param(__type="u32") 1
|
||||
|
||||
param
|
||||
each param in params
|
||||
info
|
||||
|
||||
Reference in New Issue
Block a user