add customize into data, add course score saving

This commit is contained in:
GEEKiDoS
2024-04-10 16:43:17 +08:00
parent 360ecf5013
commit d02979f410
3 changed files with 593 additions and 1 deletions
+25
View File
@@ -51,3 +51,28 @@ export interface PlayerPlayLog {
flip: number,
ghost: Buffer,
};
export interface PlayerCourseLog {
_id: ObjectId,
player: string;
playstyle: number;
kind: number;
grade_id: number;
stage: CourseStage;
total: CourseResult;
}
export interface CourseStage {
stage_num: number;
clear_flag: number;
dj_level: number;
clear_rate: number;
groove_gage: number;
}
export interface CourseResult {
clear_type: number;
max_combo: number;
clear_rate: number;
groove_gage: number;
}
+550
View File
@@ -1,4 +1,554 @@
{
"customize": {
"2": [
"I1100000",
"I1100001",
"I1100002",
"I1100003",
"I1100004",
"I1100005",
"I1100006",
"I1100007",
"I1100008",
"I1100009",
"I1100010",
"I1100011",
"I1100012",
"I1100013",
"I1100014",
"I1100015",
"I1100016",
"I1100017",
"I1100018",
"I1100019",
"I1100020"
],
"3": [
"I1200000",
"I1200001",
"I1200002",
"I1200003",
"I1200004",
"I1200005",
"I1200006",
"I1200007",
"I1200008",
"I1200009",
"I1200010",
"I1200011",
"I1200012",
"I1200013",
"I1200014",
"I1200015",
"I1200016",
"I1200017",
"I1200018",
"I1200019",
"I1200020",
"I1200021"
],
"4": [
"I1300000",
"I1300001",
"I1300002",
"I1300003",
"I1300004",
"I1300005",
"I1300006",
"I1300007",
"I1300008",
"I1300009",
"I1300010",
"I1300011",
"I1300012",
"I1300013",
"I1300014",
"I1300015",
"I1300016",
"I1300017",
"I1300018",
"I1300019",
"I1300020",
"I1300021",
"I1300022",
"I1300023",
"I1300024",
"I1300025",
"I1300026",
"I1300027",
"I1300028",
"I1300029",
"I1300030",
"I1300031",
"I1300032",
"I1300033",
"I1300034",
"I1300035",
"I1300036",
"I1300037",
"I1300038",
"I1300039",
"I1300040",
"I1300041",
"I1300042",
"I1300043",
"I1300044",
"I1300045",
"I1300046",
"I1300047",
"I1300048",
"I1300049",
"I1300050",
"I1300051",
"I1300052",
"I1300053",
"I1300054",
"I1300055",
"I1300056",
"I1300057",
"I1300058",
"I1300059",
"I1300060",
"I1300061",
"I1300062",
"I1300063",
"I1300064",
"I1300065",
"I1300066",
"I1300067",
"I1300068",
"I1300069",
"I1300070",
"I1300071",
"I1300072",
"I1300073",
"I1300074",
"I1300075",
"I1300076",
"I1300077",
"I1300078",
"I1300079",
"I1300080",
"I1300081",
"I1300082",
"I1300083",
"I1300084",
"I1300085",
"I1300086",
"I1300087",
"I1300088",
"I1300089",
"I1300090",
"I1300091",
"I1300092",
"I1300093",
"I1300094",
"I1300095",
"I1300096",
"I1300097",
"I1300098",
"I1300099",
"I1300100",
"I1300101",
"I1300102",
"I1300103",
"I1300104",
"I1300105",
"I1300106",
"I1300107",
"I1300108",
"I1300109",
"I1300110",
"I1300111",
"I1300112",
"I1300113",
"I1300114",
"I1300115",
"I1300116",
"I1300117",
"I1300118",
"I1300119",
"I1300120",
"I1300121",
"I1300122",
"I1300123",
"I1300124",
"I1300125",
"I1300126",
"I1300127",
"I1300128",
"I1300129",
"I1300130",
"I1300131",
"I1300132",
"I1300133",
"I1300134",
"I1300135",
"I1300136",
"I1300137",
"I1300138",
"I1300139",
"I1300140",
"I1300141",
"I1300142",
"I1300143",
"I1300144",
"I1300145",
"I1300146",
"I1300147",
"I1300148",
"I1300149",
"I1300150",
"I1300151",
"I1300152",
"I1300153",
"I1300154",
"I1300155",
"I1300156",
"I1300157",
"I1300158",
"I1300159",
"I1300160",
"I1300161",
"I1300162",
"I1300163",
"I1300164",
"I1300165",
"I1300166",
"I1300167",
"I1300168",
"I1300169",
"I1300170",
"I1300171",
"I1300172",
"I1300173",
"I1300174",
"I1300175",
"I1300176",
"I1300177",
"I1300178",
"I1300179",
"I1300180",
"I1300181",
"I1300182",
"I1300183",
"I1300184",
"I1300185",
"I1300186"
],
"5": [
"I1400000",
"I1400001",
"I1400002",
"I1400003",
"I1400004",
"I1400005",
"I1400006",
"I1400007",
"I1400008",
"I1400009",
"I1400010",
"I1400011",
"I1400012",
"I1400013",
"I1400014"
],
"6": [
"I1500000",
"I1500001",
"I1500002",
"I1500003",
"I1500004",
"I1500005",
"I1500006",
"I1500007",
"I1500008",
"I1500009",
"I1500010",
"I1500011"
],
"7": [
"I1600000",
"I1600001",
"I1600002",
"I1600003",
"I1600004",
"I1600005",
"I1600006",
"I1600007",
"I1600008",
"I1600009",
"I1600010",
"I1600011",
"I1600012",
"I1600013",
"I1600014",
"I1600015",
"I1600016",
"I1600017",
"I1600018"
],
"8": [
"I1700000",
"I1700001",
"I1700002",
"I1700003",
"I1700004",
"I1700005",
"I1700006",
"I1700007",
"I1700008",
"I1700009",
"I1700010",
"I1700011"
],
"11": [
"I1300000",
"I1300001",
"I1300002",
"I1300003",
"I1300004",
"I1300005",
"I1300006",
"I1300007",
"I1300008",
"I1300009",
"I1300010",
"I1300011",
"I1300012",
"I1300013",
"I1300014",
"I1300015",
"I1300016",
"I1300017",
"I1300018",
"I1300019",
"I1300020",
"I1300021",
"I1300022",
"I1300023",
"I1300024",
"I1300025",
"I1300026",
"I1300027",
"I1300028",
"I1300029",
"I1300030",
"I1300031",
"I1300032",
"I1300033",
"I1300034",
"I1300035",
"I1300036",
"I1300037",
"I1300038",
"I1300039",
"I1300040",
"I1300041",
"I1300042",
"I1300043",
"I1300044",
"I1300045",
"I1300046",
"I1300047",
"I1300048",
"I1300049",
"I1300050",
"I1300051",
"I1300052",
"I1300053",
"I1300054",
"I1300055",
"I1300056",
"I1300057",
"I1300058",
"I1300059",
"I1300060",
"I1300061",
"I1300062",
"I1300063",
"I1300064",
"I1300065",
"I1300066",
"I1300067",
"I1300068",
"I1300069",
"I1300070",
"I1300071",
"I1300072",
"I1300073",
"I1300074",
"I1300075",
"I1300076",
"I1300077",
"I1300078",
"I1300079",
"I1300080",
"I1300081",
"I1300082",
"I1300083",
"I1300084",
"I1300085",
"I1300086",
"I1300087",
"I1300088",
"I1300089",
"I1300090",
"I1300091",
"I1300092",
"I1300093",
"I1300094",
"I1300095",
"I1300096",
"I1300097",
"I1300098",
"I1300099",
"I1300100",
"I1300101",
"I1300102",
"I1300103",
"I1300104",
"I1300105",
"I1300106",
"I1300107",
"I1300108",
"I1300109",
"I1300110",
"I1300111",
"I1300112",
"I1300113",
"I1300114",
"I1300115",
"I1300116",
"I1300117",
"I1300118",
"I1300119",
"I1300120",
"I1300121",
"I1300122",
"I1300123",
"I1300124",
"I1300125",
"I1300126",
"I1300127",
"I1300128",
"I1300129",
"I1300130",
"I1300131",
"I1300132",
"I1300133",
"I1300134",
"I1300135",
"I1300136",
"I1300137",
"I1300138",
"I1300139",
"I1300140",
"I1300141",
"I1300142",
"I1300143",
"I1300144",
"I1300145",
"I1300146",
"I1300147",
"I1300148",
"I1300149",
"I1300150",
"I1300151",
"I1300152",
"I1300153",
"I1300154",
"I1300155",
"I1300156",
"I1300157",
"I1300158",
"I1300159",
"I1300160",
"I1300161",
"I1300162",
"I1300163",
"I1300164",
"I1300165",
"I1300166",
"I1300167",
"I1300168",
"I1300169",
"I1300170",
"I1300171",
"I1300172",
"I1300173",
"I1300174",
"I1300175",
"I1300176",
"I1300177",
"I1300178",
"I1300179",
"I1300180",
"I1300181",
"I1300182",
"I1300183",
"I1300184",
"I1300185",
"I1300186"
],
"10": [
"I1900000",
"I1900001",
"I1900002",
"I1900003",
"I1900004",
"I1900005",
"I1900006",
"I1900007",
"I1900008",
"I1900009",
"I1900010",
"I1900011",
"I1900012",
"I1900013",
"I1900014",
"I1900015",
"I1900016",
"I1900017",
"I1900018",
"I1900019",
"I1900020",
"I1900021",
"I1900022"
]
},
"other_customize": {
"1": [
"C1000000",
"C1000001",
"C1000002"
],
"2": [
"C1100000",
"C1100001",
"C1100002",
"C1100003",
"C1100004",
"C1100005",
"C1100006"
],
"3": [
"C1200000",
"C1200001"
],
"4": [
"C1300000",
"C1300001",
"C1300002",
"C1300003"
],
"5": [
"C1400000",
"C1400001",
"C1400002",
"C1400003"
]
},
"items": [
"I1000000",
"I1000001",
+18 -1
View File
@@ -3,7 +3,7 @@ import { eacnet } from "../../decorators/eacnet.js";
import { Context } from "../../types.js";
import { v } from "../../utils/kxml-value.js";
import { ITEM_LIST, MUSIC_LIST } from "./index.js";
import { PlayerMusicData, PlayerPlayData, PlayerPlayLog } from "../../database/index.js";
import { PlayerCourseLog, PlayerMusicData, PlayerPlayData, PlayerPlayLog } from "../../database/index.js";
import { fromToken } from "../../utils/laochan-id.js";
export class User {
@@ -21,6 +21,23 @@ export class User {
return this.db.collection<PlayerPlayLog>('player_play_log');
}
get courseLogCol() {
return this.db.collection<PlayerCourseLog>('player_course_log');
}
@eacnet('p2d')
async sendGradeCertificationLog(ctx: Context) {
await this.courseLogCol.insertOne({
player: ctx.token,
...ctx.body,
});
return {
status: v.s32(0),
error: v.s32(0),
}
}
@eacnet('p2d')
async consumeItem() {
return {