Ah. There must be something wrong with my sock.lua code then. I got an error about enet being nil, and I went down the path of thinking it was because I hadn't installed enet.zorg wrote: ↑Sat May 19, 2018 7:56 pm
And again, you don't need to do anything yourself regarding Enet, it's bundled into löve, like how luasocket is. You justand it works.Code: Select all
local enet = require 'enet'
Thanks.
Code: Select all
-- server.lua
sock = require "sock"
function love.load()
-- Creating a server on any IP, port 22122
server = sock.newServer("*", 22122)
-- Called when someone connects to the server
server:on("connect", function(data, client)
-- Send a message back to the connected client
local msg = "Hello from the server!"
client:send("hello", msg)
end)
end
function love.update(dt)
server:update()
end
Thanks for the information!