Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
$#!
 _onNewClient, UDPIPE
 _onNewMessage, UDPIPE
 _onTimeout, UDPIPE
 _setPeer, UDPIPE
 _startUdp, UDPIPE
 _unsetPeer, UDPIPE
A
 Assumptions
C
 Callbacks, UDPIPE
 close, UDPIPE
 connect, UDPIPE
 constructor, UDPIPE
G
 Game architecture
 Game description
 Game implementation
 Game implementation-stage 1
 Game implementation-stage 2
 getReceivedPackets, UDPIPE
 getSentPackets, UDPIPE
M
 Multiplayer tutorial
O
 onBadToken, UDPIPE
 onClose, UDPIPE
 onConnect, UDPIPE
 onConnecting, UDPIPE
 onDisconnect, UDPIPE
 onMaxClients, UDPIPE
 onNewClient, UDPIPE
 onNewMessage, UDPIPE
 onPing, UDPIPE
 onPong, UDPIPE
 onStalled, UDPIPE
 onUnstalled, UDPIPE
P
 ping, UDPIPE
 Private functions, UDPIPE
 Private methods, UDPIPE
 Public methods, UDPIPE
S
 send, UDPIPE
 sendAll, UDPIPE
 setDebug, UDPIPE
 setTimeout, UDPIPE
 setToken, UDPIPE
 start, UDPIPE
 step, UDPIPE
T
 The minimal example
U
 UDPIPE
 UDPIPE Description
 UDPIPE Protocol
 UDPROXY
 Useful UDPIPE methods
 Using callbacks
function M:_onNewClient(msg,
ip,
port)
Callback called when new client connection is detected.
function M:_onNewMessage(msg,
sock,
ip,
port)
Called when new packed arrives on connected socket.
function M:_onTimeout()
Called when no packet is received in some amount of time.
function M:_setPeer(sock,
rip,
rport)
Sets the peer for the socket, makes socket connected.
Starts listening for UDP packets
function M:_unsetPeer(sock)
Unsets the peer for the socket, makes socket unconnected.
What is assumed about the programmer (you) writing a game.
function M:close(skt)
Close the connection.
function M:connect(host,
port,
timeout)
Connects as a client to the server.
Creates new UDPIPE instance.
How we manage things.
What we will do.
What we use and how.
Create simple oneplayer game.
Change it to the multiplayer game.
function M:getReceivedPackets()
Returns the number of packets received.
function M:getSentPackets()
Returns the number of packets sent out.
Simplified tutorial for creating multiplayer games using lua/love.
function M:onBadToken(msg,
ip,
port)
Called when bad token is received in HELLO packet.
function M:onClose(sock)
Called when client or server closed the connection.
function M:onConnect(sock,
ip,
port)
Called when client connected to the Server, or a new client has connected.
function M:onConnecting(sock,
ip,
port)
Called when client is connecting to the Server on a final port.
function M:onDisconnect(sock)
Called when a socket is disconnected.
function M:onMaxClients(msg,
ip,
port)
Called when too much client connections is open.
function M:onNewClient(msg,
ip,
port,
ipc,
portc)
Called when new client is connected.
function M:onNewMessage(msg,
sock)
Called when new message arrives.
function M:onPing(sock)
Called when PING packet is received.
function M:onPong(sock)
Called when PONG packet is received.
function M:onStalled(sock)
Called when the connection lags.
function M:onUnstalled(sock)
Connection is no longer stalled.
function M:ping(sock)
Sends a ping message to server (in client mode) or all connected sockets (in server mode).
function M:send(msg,
sock)
Sends a message to a connected socket.
function M:sendAll(msg)
Sends a message to all connected sockets (clients).
function M:setDebug(d)
Sets the debugging.
function M:setTimeout(t)
Sets the timeout for all current and newly opened sockets.
function M:setToken(t)
Sets the token for handshaking.
function M:start(port,
host,
timeout)
Starts the server.
function M:step(dt)
Keeps the client/server running.
Here is an example of a simple client and server using UDPIPE.
Connects clients and servers with UDP.
Connects clients and servers with UDP.
Example of a raw network protocol when connecting UDPIPE client and server.
Simplifies calling UDPIPE, by serializing command names and its arguments, and sending it to the server.
For any real life application you need to use UDPIPE.Callbacks.
Close