Disconnecting clients

61 views
Skip to first unread message

Gerd Hilgemann

unread,
Oct 4, 2013, 8:33:26 AM10/4/13
to openrtmf...@googlegroups.com
i would like to know if it is correct that when i response with an error code in a lua script that i receive the full path in the actionscript response / level status.

Example Lua (only for testing):

if (cur_client.meeting == meeting) then
               
    error("test function takes two arguments");
....

Response in actionscript is:
...2p/Cumulus-master/CumulusServer/www/meetingroom/main.lua:43: test function takes two arguments

As you can see "...2p/Cumulus-master/CumulusServer/www/meetingroom/main.lua:43:".

Can i hide the full path?

What i want todo is simple disconnection when a username or pass is not correct, simple like this:

if (client.userName != "tom") then
                   error("your name is not registered");
       end

As far i can see there is no Disconnect in cur_client.disconnect function, so is it the right way to denied access with an error message or can i do in another way a close / disconnection call?

Thanks...

Gary


Mathieu Poux

unread,
Oct 15, 2013, 10:05:02 AM10/15/13
to openrtmf...@googlegroups.com
Hi Gerd,

And sorry for my last response, I am working hard on Mona.
Currently sorry the error reported is the entiere full path, I think that it's stupid me too :-) I have added it in TODO list of Mona project.

Then yes one "error" lua use is the good way to reject a new client, like illustrated here:

I have just tried it:

function onConnection(client,...)
error("eject")
end

And it ejects right the new client, I receive well a "NetConnection.Connect.Rejected" event on flash side.

Now you can eject a client too in closing his main writer, like that:
client.writer:close()
Reply all
Reply to author
Forward
0 new messages