plugins/jubeat@asphyxia/handlers/common.ts
2022-05-26 15:02:13 +09:00

23 lines
616 B
TypeScript

import { getVersion } from '../utils';
export const shopRegist: EPR = (i, data, send) => {
const locId = $(data).content('shop.locationid');
const cabId = $(data).number('shop.testmode.network.cabinet_id', 1);
const version = getVersion(i);
if (version <= 0) return send.deny();
return send.object({
data: {
cabid: K.ITEM('u32', cabId),
locationid: K.ITEM('str', locId),
...(version >= 1 && version <= 3 && { is_send: K.ITEM('u8', 1) }),
},
});
};
export const demodata = {
getNews: (_, __, send) =>
send.object({ data: { officialnews: K.ATTR({ count: '0' }) } }),
};