camchenry / sock.lua

A Lua networking library for LÖVE games.
https://camchenry.github.io/sock.lua/
MIT License
173 stars 7 forks source link

Client/self.host:connect(...) returning enet_peer without connect_id function (version mismatch?) #22

Closed Ismoh closed 2 years ago

Ismoh commented 2 years ago

As you can see in the screenshot below, there is self.connection set as enet_peer type, which is correct, but the function self.connection:connect_id() is missing. image

See function here: https://github.com/camchenry/sock.lua/blob/4c9fd32f0f33eef8da881206e8f1d5f930b99746/sock.lua#L745-L752 I am struggling since days to get this working.

As I am too stupid to build enet / lua-enet on my own, because I am not familiar with gcc (C compiling / building), I used precompiled library dlls here: https://leafo.net/lua-enet/bin/ lua-enet-1.0-51.zip Version 1.0-51 is the only one working, because the others throw this error:

error loading module 'enet11' from file 'mods/noita-mp/files/libs/enet11.dll':
    Die angegebene Prozedur wurde nicht gefunden.

I am a sotfware developer, but far away from C and Lua. Learning this new stuff in my free time, therefore it would be a pleasure to get some hints, where the problem might be and why this isn't working as expected!

I assume that the enet / enet-lua version 1.0-51, which is working and I am using, does not have the function connect_id(), therefore I need to know how to build the enet lib by my own or even how to check if the function is in that version.

Does anyone know how to "look" into dlls?

Edit: Looking into dlls is called "decompile". I found this online tool and you can see my guessing is correct.

1.0-51: https://onlinedisassembler.com/odaweb/tB8JqLia image No _peer_connect_id function/method available.

1.0: https://onlinedisassembler.com/odaweb/g6uL4yZd image Also no _peer_connect_id function/method available.

1.1: https://onlinedisassembler.com/odaweb/OxX2QC23 image There it is!

But I have still the problem to compile/build lua-enet on my own. Can someone assit?

Ismoh commented 2 years ago

I build my own lua-enet.dll, but is more specified here: https://github.com/leafo/lua-enet/issues/1#issuecomment-974751445