diff --git a/handlers/example.ts b/handlers/example.ts index 31b3813..1a0e2d1 100644 --- a/handlers/example.ts +++ b/handlers/example.ts @@ -11,12 +11,14 @@ export const example: EPR = async (info, data, send) => { /* Access data from request like this - NOTE: all card number will be automatically converted to refid. + NOTE: all card number will be automatically converted to refid|dataid. This is to support older game that doesn't use cardmng, yet still allow them to register with internal profile manager. And they can show up in WebUI as a profile, along with card binding feature. */ - const refid = $(data).attr().card; + const ids = $(data).attr().card.split('|'); + const refid = ids[0]; + const dataid = ids[1]; /* Access config like this */ const event = U.GetConfig('event'); @@ -42,7 +44,7 @@ export const example: EPR = async (info, data, send) => { Send your response like this There are more methods for sending request. */ - send.pugFile('templates/example.pug', { refid, event }); + send.pugFile('templates/example.pug', { refid, event, datid: dataid }); /* Or you can send ejs template (plain xml works as well) */ // send.xmlFile('templates/example.xml', { refid, event }); diff --git a/templates/example.pug b/templates/example.pug index 38dfe19..6ed14aa 100644 --- a/templates/example.pug +++ b/templates/example.pug @@ -2,4 +2,5 @@ Learn pug here: https://pugjs.org/api/getting-started.html example(status="0") refid(__type="str") #{refid} + datid(__type="str") #{datid} event(__type="str") #{event} \ No newline at end of file diff --git a/templates/example.xml b/templates/example.xml index 264249c..0c2d268 100644 --- a/templates/example.xml +++ b/templates/example.xml @@ -3,5 +3,6 @@ --> <%= refid %> + <%= datid %> <%= event %> \ No newline at end of file