If you want to send a command to all users you MUST use the PIPE-CHANNEL.
How do you catch the pipe channel? Using multicreatepipe event
seudo - code in the *CLIENT-SIDE*
client = new APE.Client();
..... initialization, load event, ready event, etc. ....
catch the pipe_id on to multiPipeCreate event
var pipe_id;
client.addEvent('multiPipeCreate', onMultiPipeCreate);
function onMultiPipeCreate (pipe, options) {
pipe_id = pipe.getPubid();
};
1. To send a "chat" message to all users on the channel you do the
following.var pipe = client.core.getPipe(pipe_id);
if (pipe) {
pipe.send("speech_text_to_chat");
}
The client side should handle the incoming text i.e.
client.onRaw('data',
function(raw){alert(unescape(decodeURI(raw.data.msg)))});
2. To send a custom command to all users on the channel you do the following
var pipe = client.core.getPipe(pipe_id);
if (pipe) {
pipe.request.send('custom_command_name', {param1: 'a', param2:
'b', param2: 'c'});
}
of course the server-side must handle the "custom_command_name" command
and do something there
On 01/06/2012 07:28 PM, utan wrote:
> I havent checked at all, but there seem to be some bug floating like
> some objects undefined or not available at all.. I am currently
> struggling as to how send a manually fired command by user and to
> receive it on all the user in the pipe..
> regards.
> --
> 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/