Skip to content

wenright/plexus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plexus

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.

Usage

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().

About

A networking library designed for games in lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages