Skip to main content
August 11, 2010
Question

[newbie] LoadVars action before acceptConnection in onConnect handler

  • August 11, 2010
  • 1 reply
  • 520 views

Hello, I'm FMS beginner (server side newbie in general)...

I would like to pass password and user name to the FMS while connecting, and then communicate with php script to carry authentication task, send result back to FMS and accept or reject connection with client application depending on that result. Can I do all this in onConnect handler (pls give me a clue how if yes)? If not, is there any other way to achieve described data flow?

I need to prevent any user interaction with FMS (streams publishing ect.) before identifying identity...

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    August 11, 2010

    Yes you can write that code in onConnect, till you accept connection of client it would be in pending state.

    You can think of using Access or Auth plug-in for doing authentication instead of server-side script. But if your PHP is already doing it , you can as said above use SSAS and put code in onConnect.

    August 13, 2010

    I try to handle LoadVars and accept my connection:


    Client.prototype.result_lv.onLoad = function(success)
    {
        if (success)
        {
            trace("success: "+this);
            application.acceptConnection( Client.prototype );
            Client.prototype.call("callBack", null, this.result);
        }
        else
        {
            trace("failure");
            application.rejectConnection( this );
        }
    }

    Obviously it doesnt work. How can I refer to my Client class's object in this method? FMS seems to ignore application.acceptConnection and this is related with result_lv object...