Thanks for reply.
I changed server side code like you said.
Ape.registerCmd('userLeave', true, function(params, cmd) {
var channel = Ape.getChannelByPubid(cmd.pipe);
if(channel) {
cmd.user.left(channel.getProperty('name'));
} else {
return ['401', 'UNKNOWN_CHANNEL'];
}
}
Then, restarted aped service.
>service aped stop
>service aped start
But "TypeError: cmd.user.left is not a function" error occured again.
On 5월25일, 오후2시00분, Anthony Catel <[email protected]> wrote:
> Reeves Keanu a écrit :
>
> > (Sorry about I'm not good at english.)
>
> > First, thank you for making powerful push ajax framework APE.
> > And hope to be best solution for web 2.0
>
> > I'm trying to force user to left the channel when browser closed or
> > refreshed.
> > look at this code. (I referrenced color-change demo.)
>
> > ****** Client Side ***********
> > window.onbeforeunload = function()
> > {
> > // send sever 'userLeave' command.
> > pipe.request.send('userLeave', {'foo': 'bar'});
> > }
>
> > ****** Server Side **********
> > Ape.registerCmd('userLeave', true, function(user, infos) {
> > // get channel object
> > var channel = Ape.getChannelByPubid(user.pipe);
> > if(channel) {
> > // this results server error...
> > user.left(channel.getProperty('name'));
> > } else {
> > return ['401', 'UNKNOWN_CHANNEL'];
> > }
> > });
>
> > OS - CentOS 5.4
> > I added server side command 'userLeave' however when server received
> > 'userLeave' cmd, server says "/var/ape/color.js:46:TypeError :
> > user.left is not a function".
>
> > How can I use user.left.
> > plz help me :)
>
> Hi,
>
> Arguments to the registerCmd callback are wrong
> :http://www.ape-project.org/docs/server/commands/registercmd.html
>
> i.e.
> Ape.registerCmd('foo', true, function(params, cmd) {
> cmd.user.left(channel) });
>
> Anthony C.
>
> --
> 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
> athttp://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/