Create a "raw" and send it to users

10 views
Skip to first unread message

djidi

unread,
Nov 6, 2010, 8:48:47 AM11/6/10
to APE Project
Hello,

I actually try to use APE for a project and i have some problems.
I installed APE et server works correctly.

After i made a script which show connected users, disconnected users
etc... but i have a problem to send data to others users.
When user click on the link #test, he receive :

[{"time":"1288961021","raw":"CLOSE","data":{"value":"null"}}]

And other users receive nothing.
I use the script of this page of the APE Wiki :
http://www.ape-project.org/wiki/index.php/How_to_send_hashes_rather_strings

My script is : http://pastebin.com/v4VvBcig

On the server side, i modified "/var/ape/main.ape.js" to add inclusion
of "char_pos.js" file which contain this :
http://pastebin.com/kAmtTrdT

I'm a bit lost with APE so if someone can explain what i don't do
good, this will be a great help for me.
Thanks.

djidi

unread,
Nov 8, 2010, 9:48:24 AM11/8/10
to APE Project
Nobody has an idea of what is wrong in my script ?

Felix Filozov

unread,
Nov 8, 2010, 1:13:11 PM11/8/10
to ape-p...@googlegroups.com
The following section of the wiki describes how to send custom raws: http://www.ape-project.org/wiki/index.php/How_to_create_a_server_Module#RAW

On Mon, Nov 8, 2010 at 9:48 AM, djidi <florent...@gmail.com> wrote:
Nobody has an idea of what is wrong in my script ?

--
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/

djidi

unread,
Nov 8, 2010, 3:09:50 PM11/8/10
to APE Project
Thanx but when i use "pipe.sendRaw", i get an error :

"pipe.sendRaw is not a function"

Felix Filozov

unread,
Nov 8, 2010, 3:28:08 PM11/8/10
to ape-p...@googlegroups.com
It's hard to tell what you're doing without context. I'd suggest creating a toy example, and pasting the code.

On Mon, Nov 8, 2010 at 3:09 PM, djidi <florent...@gmail.com> wrote:
Thanx but when i use "pipe.sendRaw", i get an error :

"pipe.sendRaw is not a function"

--

djidi

unread,
Nov 8, 2010, 4:18:32 PM11/8/10
to APE Project
Example is on the first post.
I have juste changed :

myPipe.send('SEND_CHAR_POSITION', {position: pos});

to

myPipe.sendRaw("SEND_CHAR_POSITION", {position: pos});

djidi

unread,
Nov 9, 2010, 6:08:56 AM11/9/10
to APE Project
Thanx, now I can receive datas (I see it on firebug).
However, I try to do something when i receive them but this doesn't
work :

myPipe.onRaw('CHAR_POSITION', function(raw, pipe) { alert('data'); });


I use something like that to show the users who connect and users who
disconnect and it's work so i don't understand what is the problem.

myPipe.onRaw('JOIN', function(raw, pipe) { alert('Say hello to
'+raw.data.user.properties.name+' !'); });

Thanx for your useful help !

djidi

unread,
Nov 9, 2010, 9:48:37 AM11/9/10
to APE Project
I finally manage to do it.
Thank for all the help.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages