leafo / lua-enet

Bindings to ENet for Lua
http://leafo.net/lua-enet/
85 stars 25 forks source link

add some server send, broadcast, channel, flag for examples. #25

Open Lightnet opened 5 months ago

Lightnet commented 5 months ago

Trying to run some example for easy understand how this code work with Love2D and Lovr. Not much docs example or explain how it works.

server.lua

for peerIndex = 1, host:peer_count() do
    local peer = host:get_peer(peerIndex)
    if peer then
      peer:send("Hi")
    end
  end

It took time to dig some issues to find this. https://github.com/leafo/lua-enet/pull/19

If you have time to update some example on client and server for send, broadcast, channel and flag.