Hi,
I looked at your code again. I'm note sure of what you are trying to do. I
understand the use of "Ape.addEvent("deluser", function (user) { ... });" for
the "setPosition" http request. But I'am note sure why you want to send a raw
to the other clients. When a client left the application, the userLeft event
(http://www.ape-project.org/docs/client/events/userleft.html) should be
automatically fired client side, informing everyone that the user just quit.
Also, I'm note sure why you need to use the $application variable. You can
always define custom properties to APE users using setProperty
(http://www.ape-project.org/docs/server/users/user.setproperty.html) and
getting the same properties with getProperty.
Here's a useful link about APE users:
http://www.xosofox.de/2010/10/ape-user-handling/
- Louis
P.S.: Je parle français aussi. Tu peux me répondre en français si tu veux, mais
ça diminue les chances que quelqu'un d'autre te répondre.
Le 2012-07-14 à 18:58, Auryn a écrit :
> Hum...
>
> If I understand the pipes, the "user.pipe" is use to send a raw to the user
> and not to all the users of the channel no ? :/
>
> Le dimanche 15 juillet 2012 00:41:18 UTC+2, Auryn a écrit :
> Hi everybody ! :)
>
> So i'm trying to return a raw to the users of the channel when an user leave
> and i've this code :
>
> Ape.addEvent("deluser", function (user) {
> if ($defined($application.users[user.getProperty("ID")])) {
> var setPosition = new Http("http://mywebsite.fr:80/APE-setPOSITION=" +
> user.getProperty("ID") + "-" + $application.users[user.getProperty("ID")].x +
> "-" + $application.users[user.getProperty("ID")].y + ".html");
>
> setPosition.getContent(function (resultat) {
> var pipe =
> Ape.getPipe($application.users[user.getProperty("ID")].pipe);
> if (!$defined(pipe)) return ["4400",
> "WHERE_S_THE_PIPE"];
>
> $application.users[user.getProperty("ID")] = '';
>
> pipe.sendRaw('deletePlayer', {
> 'id': user.getProperty("ID")
> });
> });
> }
> });
>
> When an user connects himself to my application the server-side save the
> "params.pipe" of the command in "$application.users[id_of_user].pipe" and I
> try to return a raw with this pipe to the other users in the channel.
> But it don't work.
> I send a log on my application to know if the raw "deletePlayer" is return
> but it isn't.
>
> How can I do ? :o
>
> Thanks very much for your help ! ^^
>
> P.S : Sorry for my english, I'm french. ^^
>
> --
> 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/