Well, I show you my script so you can understand my situation:
*var userlist = new $H;*
*var userdata =new $H; //(id,pubid)*
*var usercook =new $H; //(id,cookie)*
*Ape.registerHookCmd("connect", function(params, cmd) {*
* if (!$defined(params) || !$defined(params.name)) return 0;*
*// if (userlist.has(params.name)) return ["007", "NICK_USED"];*
* //if (params.name.length > 16 || params.name.test('[^a-zA-Z0-9]',
'i')) return ["006", "BAD_NICK"];*
*
*
* cmd.user.setProperty('nick', params.nick);*
* cmd.user.setProperty('name', params.name);*
*
*
* return 1;*
*});*
*
*
*Ape.addEvent('adduser', function(user) {*
* userlist.set(user.getProperty('name'),true);*
* //userdata.set(user.getProperty('name'),
user.getProperty('pubid'));*
* if(user.getProperty('pubid').length > 12){*
*
userdata.set(user.getProperty('name'),user.getProperty('pubid'));*
* }*
*});*
*
*
*Ape.addEvent('deluser', function(user) {*
* userlist.erase(user.getProperty('name'));*
* userdata.erase(user.getProperty('name'));*
* usercook.erase(user.getProperty('name'));*
*});*
*
*
*Ape.registerCmd('checkwin',true,function(params,infos){*
*//ventana Chat abierta? la ventana contestara al ACK*
*
infos.user.pipe.sendRaw('checkwinACK',{'user':params.name,'f':params.f});*
*});*
*
*
*Ape.registerCmd('getUserData',true,function(params,infos){*
*//obtiene datos de otro usuario(pubid,nick..). si no ea online devuelve el
propio ID del usuario*
* var us = Ape.getUserByPubid(userdata.get(params.name));*
* if(us==null){*
*
infos.sendResponse('userdata',{'user':params.name,'nick':params.nick,'pubid':params.name,'funct':params.funct});
*
* }else{*
*
infos.sendResponse('userdata',{'user':params.name,'nick':us.getProperty('nick'),'pubid':us.getProperty('pubid'),'funct':params.funct});
*
* }*
*//funct= 0: rellena desde inbox; 1: otros*
*});*
*
*
*Ape.registerCmd('IamWr',true,function(params,infos){*
*//usuario esta escribiendo. Params(usuario a quien esta escribiendo)*
*//si usuario no esta conectado no envia nada*
*//params: pubid (del destinatario a quien escribe)
W=true||false (esta escribiendo o no)*
* var us = Ape.getUserByPubid(params.pubid);*
* if(us!=null){*
*
us.pipe.sendRaw('isWr',{'pubid':infos.user.getProperty('pubid'),'W':params.W,'nick':params.nick});
*
* //pubid: de quien esta escribiendo; W: si escribe o no*
* }else{*
*
infos.sendResponse('notallo',{'pubid':params.pubid,'name':params.name});*
* }*
*});*
*
*
*I'm not using channels and I use command 'getUserData' to get pubid from a
user who is online. If a user is not online I use pubid = ID user.*
--
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/