A networking library for games in Lua. Written for LOVE games, but can be used in any Lua program as long as LuaSockets are available.
To start a server
Server.start(3000)To connect to that server
Network.connect('127.0.0.1', 3000)Plexus uses listeners to trigger messages received from the server. For example...
Network.on('ping', function(message)
print('Received a message!")
end)... will tell the network to call that function once it receives a 'ping' command. To execute that command, use...
Server.send('ping', Network.getTime())... On the server side. The second parameter is the message you are sending. This can be anything from a number to a table.
send will be called immediately, but the callbacks for on are only triggered in update. So, make sure to have some sort of an infinite loop calling Network.update().