I want check if the user is stored in my database before connect:
Ape.registerHookCmd("connect", function(params, cmd) {
cmd.sendResponse('info', {'step':'0'});
var sql = new Ape.MySQL('IP:3306', 'user', 'psw', 'database');
sql.query('query', function(res, errorNo) { /* Async call (after
return -2) */
cmd.sendResponse('info', {'step':'1'});
//some controls.....
//cmd.user.setProperty('tested', 'ok');
});
return -2;
});
Ape.addEvent('adduser', function(user) {
user.pipe.sendRaw("info", {"step":"2"});
});
Why the client receive this sequence of steps: 0 2 1 ?
I must use -1 like http_auth.js template file in framework folder
(server side)?
Please help me! Thanks!!!!
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/