mirror of
https://github.com/asphyxia-core/plugin-template.git
synced 2026-03-21 17:24:33 -05:00
update example for v1.31b
This commit is contained in:
parent
96805263fc
commit
a9515e3b9e
|
|
@ -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 });
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
@ -3,5 +3,6 @@
|
|||
-->
|
||||
<example status="0">
|
||||
<refid __type="str"> <%= refid %> </refid>
|
||||
<datid __type="str"> <%= datid %> </datid>
|
||||
<event __type="str"> <%= event %> </event>
|
||||
</example>
|
||||
Loading…
Reference in New Issue
Block a user