Ok, finally I've solved my problem. I had the server set to restore
(set the user pubid to the old one) if the user was already connected
(page refresh for example) and that was preventing the user to get his
"old pipe" or even a "new pipe" to send data to the server:
clientConnect: function(params, cmd) {
Ape.log("User connecting... "+cmd.toSource());
if (!$defined(params) || !$defined(params.uid)) return 0;
if (params.uid.length > 16 || params.uid.test('[^0-9]',
'i'))
return ["006", "BAD_NICK"];
var tuid = params.uid;
cmd.user.setProperty('uid', params.uid); //the userid
on the mysql
db
cmd.user.setProperty('sid', params.sid); //php session
id
Ape.log("User connected with pubid:
"+cmd.user.getProperty('pubid')
+" and sessionid: "+cmd.user.getProperty('sid'));
if (this.userslist.has(tuid)) {
//I removed it to solve the problem
//Ape.log("User already connected, setting his
pubid to:
"+this.userslist.get(tuid));
//cmd.user.setProperty('pubid',
this.userslist.get(tuid));
//tpubid = this.userslist.get(tuid);
}
this.userslist.set(tuid, cmd.user.getProperty('pubid'));
if(this.updateUser(cmd.user, params)){
params.pipe = {pubid:params.pipe}
}
// retrieve the username from the database
this.getUsername(tuid, function(nresult) {
cmd.user.setProperty('username',
nresult);
cmd.user.username = nresult;
cmd.user.connected = true;
cmd.user.pipe.sendRaw('clientready',
{pubid:tpubid});
}.bind(this));
return 1;
},
I still have a question to ask but Ill also open a new topic for
anyone that might know the answer. Im wondering in which ways would it
be better to restore a user's session on APE in terms of doing a multi-
channel/private chat. (IRC like), for example, would it fire the
userjoin event again on all users connected or not.
Thank you for your help Pablo and Louis.
Regards
--
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/