(Project from July 2018)
Love2D Networking (UDP/TCP)
Lua networking library for Love2D games
Example usage
local nut = require 'love_nut'
chat = '--Chat:\n'
server = nut.server{port=1357}
server:addRPCs{
chat_msg = function(self, data, clientid)
self:sendRPC('chat_msg', data)
end
}
server:start()
client = nut.client()
client:addRPCs{
chat_msg = function(self, data)
chat = chat .. data
end
}
client:connect('127.0.0.1', 1357)
function love.update(dt)
server:update(dt)
client:update(dt)
end
function love.textinput(t)
client:sendRPC('chat_msg', t)
end
function love.draw()
love.graphics.print(chat, 20, 20)
end
function love.quit()
server:close()
client:close()
end
Downloads/documentation on Github