mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-21 17:34:46 -05:00
23 lines
616 B
TypeScript
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' }) } }),
|
|
};
|