What you could do is create a hook on the JOIN command which would fire userLeft in all other rooms the user is part of but the one joining
Sent via BlackBerry from T-Mobile -----Original Message----- From: Louis Charette <[email protected]> Sender: [email protected] Date: Tue, 7 Feb 2012 11:35:56 To: [email protected]<[email protected]> Reply-To: [email protected] Subject: Re: [APE Project] Re: users join event I don't use sessions, but in my case as soon as a user refresh the page or close the windows, the "userleft" is always fired after the (annoying) delay. Envoyé de mon iPhone Le 2012-02-07 à 11:20, Giuseppe Mastrandrea <[email protected]> a écrit : > Ok, guys, another question: > this time i'm facing the userLeft event. When i close the > browser,after a certain amout of time a LEFT raw is launched, as the > serverreceives no more request from the client. But what if i just > changeroom? I remind you that i'm using a server-based chatroom > system.Here's the scenario: > UserA connects to "http://localhost/chat/1"UserB connects to "http:// > localhost/chat/1" > The userlist now is formed by both users. > Now. > UserB connects to "http://localhost/chat/2" (in the same window/tab) > I expect that userlist in chat/1 would refresh, showing just > UserA;unfortunately the LEFT raw is never launched, i suppose that > happensbecause i'm using sessions, so in a certain way there is always > astable connection between client and ape-server, and a userLeft > eventis never fired. > Any idea? > On 7 Feb, 15:31, Giuseppe Mastrandrea <[email protected]> > wrote: >> Yes, you're absolutely right! I've just noticed it, and as a temporary >> solution i've used a simple "if" statement that checks for the >> pipe.properties.name. Yes, it's a bit rough, but it works! >> >> Many thanks for your suggests :) >> >> On 7 Feb, 15:24, Louis Charette <[email protected]> wrote: >> >> >> >> >> >> >> >>> If i remember correctly, When a user join a channel, the other client will >>> receive a "userjoin" whatever channel they're in. When the even is >>> triggered, you can check what channel the new user just joined with >>> "pipe.name". >> >>> Also, when a user Join a channel, he'll received a "userjoin" even for >>> everybody already in the channel. You can then build the user list with >>> this. You could also code a server side command using the command >>> "userlist" to get a list of everybody in the >>> channel:http://www.ape-project.org/docs/server/channels/userslist.html >> >>> Envoyé de mon iPhone >> >>> Le 2012-02-07 à 09:01, Giuseppe Mastrandrea <[email protected]> >>> a écrit : >> >>>> Many thanks, i'm using it, already :-) >> >>>> Another weird problem. I've got two channels (substantially, they're >>>> different pages, with these urls:http://local-domain/chat/1and >>>> http://local-domain/chat/2) >> >>>> What i do is trying to connect with a channel named with the URL >>>> number slug ("1", "2", etc), >> >>>> Now, when i connect to the first room, everything's ok, i can see >>>> users, send PM messages, and so on. >>>> If i try to connect to the other room (http://local-domain/chat/2) >>>> what i see is the users list from the second room AND the users list >>>> from the first one! >> >>>> Using firebug console, i can see that into CHANNEL raw i get the users >>>> coming from the OTHER channel... isn't it weird? or maybe i didn't >>>> study the protocol carefully :-) >> >>>> On 6 Feb, 19:26, Louis Charette <[email protected]> wrote: >>>>> Hi >> >>>>> Have a look at this. When a user join a channel, this event is fired >>>>> client side.http://www.ape-project.org/docs/client/events/userjoin.html >> >>>>> - Louis >> >>>>> Le 2012-02-06 à 13:12, Giuseppe Mastrandrea a écrit : >> >>>>>> Hello everyone, proud ape developers! >>>>>> I'm trying to implement a chat system with custom commands/raws, a bit >>>>>> different from the example on ape-project website. >> >>>>>> There is something, though, that i still can't understand. >> >>>>>> I have to update the users list, so i thought i could build a client- >>>>>> side hashmap containing informations about the currently logged in >>>>>> users. Fine, but what event should i listen for? >> >>>>>> I see, when i try to connect with my user, a row named "LOGIN" in >>>>>> firebug; when i try to connect from chrome on the same channel i see >>>>>> instead (on firebug) the JOIN raw, who has got informations similar to >>>>>> LOGIN raw. >> >>>>>> Shouldn't i listen for the "CHANNEL" event to have new >>>>>> users'notifications?? I read this: >> >>>>>> http://www.ape-project.org/wiki/index.php/Protocol_Basics >> >>>>>> ...and that's what i understood. >> >>>>>> So, i ask... what event should i listen for, to track a user's >>>>>> connection into a channel? >> >>>>>> -- >>>>>> 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/ >> >>>> -- >>>> 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/ > > -- > 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/ -- 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/ -- 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/
