LuaSocket and Mod debugging (Yet another try)

LuaSocket and Mod debugging (Yet another try)

Postby Eightball » Tue Apr 02, 2019 4:31 pm

Hi there,

I'm trying really hard to get debugging of a Mod working. There were attemps to do this in several ways, but I always come to the point: compile LuaSocket by yourself.
Checking the Minetest sources I found the Socket and thought about reusing this instead of LuaSocket, but the existing Sockets are UDP sockets and LuaSockets are TCP.

So I need some advice from you, which approach might be the most successful:
- compile LuaSocket into Minetest like Lua interpreter is done
- change Minetest to use dynamically link Lua interpreter so precompiled LuaSocket binaries can reuse this library
- extend existing Socket implementation so e.g. mobdebug debugger can use those instead of LuaSocket

I'm not yet ready to accept that debugging Lua code with Minetest should not be possible. Also I saw that LuaSocket might be useful for other mods. So integrated version will make things easier.

Please do not give advise that I can do debugging by printing to debug.txt, I know about that possibilities ;-)

Thanks in advance
Eightball
New member
 
Posts: 7
Joined: Sun Mar 24, 2019 11:12 am

Re: LuaSocket and Mod debugging (Yet another try)

Postby texmex » Tue Apr 02, 2019 5:35 pm

Interested as well!
texmex
Member
 
Posts: 1284
Joined: Mon Jul 11, 2016 9:08 pm
GitHub: tacotexmex
In-game: texmex

Re: LuaSocket and Mod debugging (Yet another try)

Postby ThorfinnS » Wed Apr 03, 2019 4:27 am

Me, too!

Really want to see what you are working on that would use LuaSocket.
ThorfinnS
Member
 
Posts: 61
Joined: Mon Feb 25, 2019 10:05 pm

Re: LuaSocket and Mod debugging (Yet another try)

Postby sofar » Wed Apr 03, 2019 4:59 am

According to their website, LuaSocket supports UDP and TCP. And since it's C code, changing it wouldn't be too difficult. The MT core uses UDP for the minetest protocol (server-client), but it uses TCP for the native HTTP methods that are exposed to Lua (although it may use libcurl for that). So all the support for sockets should be there.

I don't see why luaSocket/mobDebug don't work though? did you build the right dynamic modules using luarocks?
sofar
Developer
 
Posts: 2034
Joined: Fri Jan 16, 2015 7:31 am
GitHub: sofar
In-game: sofar

Re: LuaSocket and Mod debugging (Yet another try)

Postby Eightball » Wed Apr 03, 2019 4:50 pm

The current MT version I use (5.1.0), has the HTTP methods implemented with libcurl.

My first approach would to be have something that does not require to compile MT locally to have the libs to link against. Which would be needed by separate luasocket compilation. Thats what I understand from the code, it needs access to the Lua interpreter which is compiled into MT. Please correct me when I'm wrong here.

I also think that basically everything should be available to get sockets working. But I'm not sure about the best solution that will also help others that do not want to compile MT and luasockets themselfs. (Which is not the easiest, especially both connected)
Eightball
New member
 
Posts: 7
Joined: Sun Mar 24, 2019 11:12 am



Return to Modding Discussion



Who is online

Users browsing this forum: Yandex Bot [Bot] and 0 guests