OpenRTMFP / Cumulus

CumulusServer is a complete open source and cross-platform RTMFP server extensible by way of scripting
http://groups.google.com/group/openrtmfp-cumulus
GNU General Public License v3.0
593 stars 221 forks source link

cirrus sample doesn't work #86

Closed marshal64 closed 11 years ago

marshal64 commented 11 years ago

Point "Why the cirrus sample doesn't work?" in the FAQ stopped working. Apparently, this is due to changes in the RPC after April.

cumulusdev commented 11 years ago

Hi, could you confirm it with the new release of Cumulus?

marshal64 commented 11 years ago

I now testing the script: function onConnection(client,...) function client:relay(targetId,...) target = cumulus.clients(targetId) if not target then error("client '"..targetId.."' not found") return end target.writer:writeAMFMessage("onRelay",self.id,unpack(arg)) target.writer:flush(true) end end

Not works... On the line "target.writer:writeAMFMessage("onRelay",self.id,unpack(arg))" error is given: "bad argument #1 to 'unpack' (table expected, got nil)"

And immediately there was a new question: how to check the validity of the key on server in onConnection function?

cumulusdev commented 11 years ago

Try in replacing "unpack(arg)" by "unpack({...})" and tell me...

You can test variable with a simple "print", or in using log (NOTE, INFO, etc... see "Server Application" wiki page)

cumulusdev commented 11 years ago

Ok, you are right I think, it was a problem with "depreciated keyword arg" since LUA 5.1... Use directly it instead of: target.writer:writeAMFMessage("onRelay",self.id,...)

More light, more clean, and works :-) I have fixed documentation about it everywhere, thanks

marshal64 commented 11 years ago

All works! Thanks.