Files
plugins/iidx@asphyxia/handlers/userdata.ts
duel0213 2af97e685d IIDX: Fixed where unable to login in 9th Style
IIDX: Fixed where CYBER LOADER event data get saved incorrectly
IIDX: Fixed where Entry background brightness option doesn't get saved
IIDX: Fixed where classic_hispeed option doesn't get applied
IIDX: Add qpro_back on shop_rank_data response
2026-10-11 22:19:40 +09:00

33 lines
862 B
TypeScript

import { userdata } from "../models/userdata";
export const userdataread: EPR = async (info, data, send) => {
const refid = $(data).attr().card.split('|')[0];
const user = await DB.FindOne<userdata>(refid, {
collection: "userdata",
});
if (_.isNil(user)) return send.object({}, { status: "SOK", format: false, header: false });
return send.object({
b: K.ITEM("str", user.userdata),
}, { status: "SOK", format: false, header: false });
}
export const userdatawrite: EPR = async (info, data, send) => {
const refid = $(data).attr().card.split('|')[0];
const userdata = $(data).str("b");
await DB.Upsert<userdata>(
refid,
{
collection: "userdata",
},
{
$set: {
userdata
}
}
);
return send.object({}, { status: "SOK", format: false, header: false });
}