sock.lua icon indicating copy to clipboard operation
sock.lua copied to clipboard

Outdated docs

Open MightyPancake opened this issue 1 year ago • 0 comments

Hey there. First of all, thank you for this amazing lib. Honestly, it' the best I've found yet! It's really easy and intuitive. I believe the examples are a bit outdated tho!

In the hello example, one can read this piece of code:

server:on("connect", function(data, peer)
        local msg = "Hello from server!"
        peer:send("hello", msg)
    end)

While the docs state that server on callbacks will be given data and client object, not peer object. It might be better to adjust the examples or add a server:sendToClient(client, event, data) function so it's even easier!

Cheers! 😄🍻🎉

MightyPancake avatar Oct 26 '24 16:10 MightyPancake