Jump to content

Recommended Posts

It's been years since anyone has mentioned anything about LuaSocket and its usability in Don't Starve Together. Since I am currently in the process of making a mod that requires the internet extremely briefly (just to receive one string), I've come across LuaSocket in my research. The only mention of this in the context of Don't Starve was when @simplex mentioned it a long time ago here:

and I know simplex knows quite a lot about the stuff working behind Don't Starve...

My brother and I put it into a mod and tried to load it up, but our final problem was in getting lua to accept the core.dll file that was key to the whole thing. I've seen in some places that Don't Starve does not accept LuaSocket, however all that conversation happened about 5 years ago (at least).

I really want to know if someone else has any information on it. If @PeterA knows anything about Don't Starve's lua limitations in terms of adding packages, that would be amazing.

For more details about this crazy researching venture, we are currently experimenting using python and its urllib package and attempting to let it talk to lua using Lunatic-Python. It's getting complicated since we'll probably end up having to include a copy of python 3+ AND lua 5.1+ in the mod which is VERY unconventional to say the least. There's also a C module called http that let's you access the internet, but we're not sure how to plug that one in since it doesn't have any lua.

--------------------

For those who don't know, LuaSocket is basically just an extension to lua that allows you to access the internet.

Lunatic-Python github is here:

https://github.com/bastibe/lunatic-python

 

Edited by rawii22
Link to comment
Share on other sites

  • Developer

the game has TheSim:QueryServer() which you can probably make work. The game cannot and will not load dll's nor can you in any way shape or form break out of the sandbox the game has put in place, anything run outside the game would have to be externally setup by every user who installed it.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, Zarklord said:

the game has TheSim:QueryServer() which you can probably make work.

Does this let you enter a url or something like that? We have a lists of the "The..." functions, we just can't know their parameters since they're defined somewhere else that's inaccessible...

  • Like 1
Link to comment
Share on other sites

@Zarklord I cannot thank you enough for bringing this function to our attention. I managed to make it work perfectly.

 

We spent an unhealthy amount of time trying to find a way to access the internet getting into some extremely obscure methods :wilson_smile: crazy rare lua articles. Turns out there's a function in game that's used a handful of times that we never knew about... Thanks again

  • Like 1
Link to comment
Share on other sites

  • Developer

Yeah, as Zarklord said, we've disabled library loading for security reasons. We actually use luasockets internally in dev builds for some stuff, but haven't made that a release feature yet. If you just need to pull down data from the internet, TheSim:QueryServer() is a good use of that.

Ahhh, you got it working, great to hear!

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...