Page 1 of 3

LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 1:32 am
by Katorone
Will LTSL let us work with files and/or sockets?

Uses I'm considering:
- A custom log file where specific events are logged.
- A variation of the first, where an automatic html diary is generated by a mod.
- Sockets can be used to make modded multiplayer, or at least a cool proof of concept.
- And, I'd love the ability to write an IRC client or even a browser inside LT, so people can stay in touch with the community, without having to leave the game.

I'm sure there are many many more... So, please, can we have? :D :squirrel:


Edit: not to mention that sockets could be used to browse mod databases, get alerted of updates or even automatically download new versions. It should probably be enough to make socket(), bind(), connect() and listen() available through LTSL.

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 2:29 am
by Cornflakes_91
TCP sockets open up a big can of worms regarding network security...
I see what you want to do Kato, but i thus word my concerns with opening up LT to the internet as a modding-only feature....

Nothing against pipes (as when pipes make LT problematic, your computer was problematic beforehand), they would make that custom control app for tablets that i want(ed) to make possible. ^^

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 4:45 am
by Katorone
A socket in itself is harmless. Are you worried about some attacker getting access to your computer through LT?
If you limit hard disk access to a chrooted environment, you wouldn't have to worry about that.
Also, the scripts are human readable, so peer review is possible and will happen.

Or are you thinking something else?

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 5:22 am
by Cornflakes_91
Pretty much intrusion danger, yes.

But i dont know very much about sockets and TCP in general, im just using it xD

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 5:36 am
by Katorone
ah... well, don't have a panic attack then !
There's nothing wrong with sockets. Having sockets doesn't mean you'll need to worry about opening up an attack vector to your computer.

A socket can read or write. Most sockets used in mods will be the writing kind. They won't accept input all the time. It's the server-side script that would listen to client connections.
Hackers can't use these writing sockets to hack you, because the sockets aren't accepting any input. When they do, it's after a handshake, and it's established that the other party is trustworthy.

If you're really worried about this, I'm guessing you already took precautions. Having a decent (hardware) firewall like a router is a great way to not having to worry too much about opening ports for listening, since it's hard to bypass the router anyway. Besides that there are always the software firewalls that will alert you when an application is trying to make receive or initiate a connection.

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 5:44 am
by Cornflakes_91
Just wording concerns.

Im also most likely too bad protected to have the right to make much noise in this direction ^^

If you say its fine, then it'll be fine ^^

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 5:45 am
by Katorone
Yeah... compare it to a browser. A browser doesn't listen to connections per sé, it just opens a connection to a webserver, fetches what it needs and closes the connection again.

And with peer review, I really don't think a culture of exploitative scripts would happen on LT. :)

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 5:51 am
by Cornflakes_91
Im less thinking about "virus" scripts in LT but a general security weakness introduced by making LT network capable in general

Re: LTSL - pipes & sockets ?

Posted: Wed Jul 30, 2014 8:38 pm
by Flatfingers
The point about database access is interesting.

I'm wondering now how LT will store the vast reams of data about the universe of a game. Josh mentioned in a recent devlog that he was considering adding data structures to LTSL, and I suppose you could store and expose active game data that way (universe = big honkin' list of lists).

But it might be advantageous to handle data -- at least the big stuff -- through some kind of structured database. In that case, LTSL would need some way to make database calls. You could bake those into LTSL, but I suppose sockets would be another way, and they'd offer additional capabilities.

Regarding file handling, doesn't LTSL already have to be able to read data from files? Not directly, but through a built-in function?

Re: LTSL - pipes & sockets ?

Posted: Thu Jul 31, 2014 1:55 am
by Katorone
Flatfingers wrote:Regarding file handling, doesn't LTSL already have to be able to read data from files? Not directly, but through a built-in function?
Sure, it should already be able to handle files. But I don't know in how far it can be used by mods to read and write arbitrary files.
To me it would make sense to not let LTSL write to files outside of the mod or universe directory though. Not so much because I think it'll be abused, but because accidents happen. Secondly because I'd like my files together, and not spread over all kinds of structures modders could come up with. And, seeing as we're dealing with a cross platform game, it just makes sense. :)

Re: LTSL - pipes & sockets ?

Posted: Thu Aug 07, 2014 5:38 am
by Kekasi
I asked Josh in IRC about what network functionality is visible to LTSL and he said currently there is none, but he will add it in post launch at the latest.

With files, it's almost a guarantee that there will be forms of reading and writing to files, solely because of config files.

Re: LTSL - pipes & sockets ?

Posted: Thu Aug 07, 2014 6:52 am
by Katorone
Thank you for asking and updating this thread. :D

Re: LTSL - pipes & sockets ?

Posted: Thu Aug 07, 2014 10:23 am
by DWMagus
Even if it's something as simple as reading/writing to files, then that output can easily be changed to a network stream.

Re: LTSL - pipes & sockets ?

Posted: Mon Aug 11, 2014 4:14 am
by Daniel
Kekasi wrote:With files, it's almost a guarantee that there will be forms of reading and writing to files, solely because of config files.
Could simply have the configuration as constants at the top of the script.

Re: LTSL - pipes & sockets ?

Posted: Mon Aug 11, 2014 4:46 am
by Cornflakes_91
Kekasi wrote:I asked Josh in IRC about what network functionality is visible to LTSL and he said currently there is none, but he will add it in post launch at the latest.

With files, it's almost a guarantee that there will be forms of reading and writing to files, solely because of config files.
Im pretty sure josh doesnt want his config variables spread over a hundred scripts but all stored in a nice little config file.

So we have (at least indirect) read access.

And as it would be a equal chore not being able to store changed configs we will have write access to files.

In sum im confident that we will have some kind of file access available