Page 1 of 1

Celestia 1.5.1 and sockets?

Posted: 21.05.2009, 14:44
by Stuffer
Hi!

Does Celestia 1.5.1 work with sockets somehow?

I tried the same approach as I did with Cel 1.6 where I simply copied the folders "lua", "mime" and "socket" into the Celestia root folder.
But with a celx script there's always the error "attempt to call global 'require' (a nil value)"

the script is

Code: Select all

require "socket"

local socket = socket.tcp()
...


Is there sth. else that has to be done to be able to use the socket library in Cel 1.5.1?
I use the socket lib 2....
I also tried copying the lua folder into the extras folder. Didn't work either.
I want to provide an add-on but it works only for Cel 1.6 yet.

Thanks for every hint on this
--Stuffer

Re: Celestia 1.5.1 and sockets?

Posted: 21.05.2009, 15:13
by chris
Stuffer wrote:Hi!

Does Celestia 1.5.1 work with sockets somehow?

I tried the same approach as I did with Cel 1.6 where I simply copied the folders "lua", "mime" and "socket" into the Celestia root folder.
But with a celx script there's always the error "attempt to call global 'require' (a nil value)"

The problem is that in Celestia 1.5.1 'require' was only permitted in hook scripts by default. But, if you change ScriptSystemAccessPolicy to 'Allow', it should work in 1.5.1 as well

--Chris

Re: Celestia 1.5.1 and sockets?

Posted: 21.05.2009, 15:21
by Stuffer
Thanks Chris,

hm, actually I already changed systemaccesspolicy.

But I can try the hook script. If it works there it would be sufficient for my purposes.

Stuffer

EDIT: seems to work. Thanks Chris