Why not store directly the pipe?

Pelican.onlineusers.set(params.me, info.pipe);

Then somewhere else, when you need the pipe:

Pelican.onlineusers.get("yourUniqueId").sendRaw("RAW", {"foo":"bar"});

This is what I did on my chat system and it works perfectly :)

Cadrach

On Jan 6, 11:39 am, ryan <[email protected]> wrote:
> Hello
>
> I'm writing an advanced messaging application using APE, my first
> project using it, so trying to get my head around a few things.
>
> I'm looking to store a unique user id and the pipe associated with
> that user in a hash, but I also need to be able to send the pubid of
> that pipe/user to the client in order for them to reference it.
>
> My problem is that I don't seem to be able to get the pubid even
> though there is a pipe.getPubid() method.
>
> my basic code is...
>
>         // fired when a user gets logged in
>         Ape.registerHookCmd("CONNECT", function(params, info) {
>
>                 // add me to online users
>                 Pelican.onlineusers.set(params.me, info.pipe.getPubid());
>
>       .....
>
> Is this even possible? I basically need a way of being able to
> reference the unique user id (params.me) to a user, and then be able
> to send messages to that user...
>
> Maybe there is a better way to do this?
>
> Thanks,
> Ryan
-- 
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/

Reply via email to