Erick

I have it just like you suggested and still let me go all the way..

request.getContent(function(result){
        if(result != ""){
                Ape.log(result);
                cmd.sendResponse('ERR', {'code': 1001, 'value':'User BANNED'});
                        return 0;
                        }else{
                cmd.user.setProperty('name', params.name);
                cmd.user.setProperty('ip', cmd.ip);

                return 1;
                        }
        }).bind(this);
the only differences there is , is that your have a more recent build
than me, I think I have 111 or something along those lines..
I am frustrated..

On Jan 23, 1:08 pm, Erick Romero <[email protected]> wrote:
> Because getContent is another function inside hook-connect and you
> should be returning true or false for getContent and not for hook-connect.
>
> To have hook-connect drop a connection inside getContent, you should use
> the cmd.sendResponse[ERROR] instead, which makes the "trick"
> I included "return 0;" inside getContent just is to have "things logic"
> but really the job is made by the above command.
>
> In the other hand, the following two logic do the same in the hook-connect :
>
> if ( ! params || ! params.session_id) {
>     return 0;
>
> }
>
> ----------
>
> if ( ! params || ! params.session_id) {
>     cmd.sendResponse('ERR', {'code': NNNN, 'value': 'BAD params'});
>     return; // ==> just to the stop following logic
>
> }
>
> On 01/23/2012 02:57 PM, utan wrote:
>
>
>
>
>
>
>
> > Erick,
>
> > if this code,  if (!$defined(params) || !$defined(params.name)) return
> > 0; doesnt let you login , why if I return 0 inside request.getContent
> > wouldnt do the same?
> > I am cant figure this out....
>
> > On Jan 23, 12:24 pm, Erick Romero <[email protected]> wrote:

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