Creating multiple channels

30 views
Skip to first unread message

RonnieV

unread,
May 20, 2012, 9:31:59 AM5/20/12
to ape-p...@googlegroups.com
Hi,

I know this is described in the help but i cant seem to figure out how to create multiple channels. I have one channel currently in use to push highscore info, this works fine. I now also would like to have some sort of chat channel. does someone has an example how to create multiple channels?

Best Regards,
Ronnie

Louis Charette

unread,
May 20, 2012, 10:40:38 AM5/20/12
to ape-p...@googlegroups.com
Just make the user join the second channel, the server is gonna create it if it doesn't already exist. You could created it manually with some server side code also if you want, but it's not necessary.

  - Louis 

Envoyé de mon iPad
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
ape-project...@googlegroups.com
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/

RonnieV

unread,
May 20, 2012, 3:12:46 PM5/20/12
to ape-p...@googlegroups.com
Hi,

Ok that seems to work indeed :) I only ran into another problem which look really weird to me. When posting a message in the new channel it also triggers the other channel and so i got duplicate messages. does this sounds familiar to you?

Ronnie

Louis Charette

unread,
May 20, 2012, 3:15:22 PM5/20/12
to ape-p...@googlegroups.com
Kind of. I think it depend how you use the "send" command. On core.request.send or if you use the send command on a pipe. 

  - Louis


RonnieV

unread,
May 20, 2012, 3:40:22 PM5/20/12
to ape-p...@googlegroups.com
I am using it like

var chan = Ape.getChannelByName('highscores');
            if (!$defined(chan))
                return ["401", "UNKNOWN_CHANNEL"]; 
           
            chan.userslist.each(function(user) {
                params.friends = user.friends;
                params.userid = user.getProperty('id');   
                if(in_array(user.getProperty('id'), user.friends)) {
                    user.pipe.sendRaw('highscore', { from: user.getProperty('id'), content: params.data });
                }
            });


On Sunday, May 20, 2012 9:15:22 PM UTC+2, Louis Charette wrote:
Kind of. I think it depend how you use the "send" command. On core.request.send or if you use the send command on a pipe. 

  - Louis


Le 2012-05-20 à 15:12, RonnieV a écrit :

Hi,

Ok that seems to work indeed :) I only ran into another problem which look really weird to me. When posting a message in the new channel it also triggers the other channel and so i got duplicate messages. does this sounds familiar to you?

Ronnie

On Sunday, May 20, 2012 3:31:59 PM UTC+2, RonnieV wrote:
Hi,

I know this is described in the help but i cant seem to figure out how to create multiple channels. I have one channel currently in use to push highscore info, this works fine. I now also would like to have some sort of chat channel. does someone has an example how to create multiple channels?

Best Regards,
Ronnie

--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to ape-p...@googlegroups.com
To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages