CreateDevice

From OxeyeWiki

Revision as of 13:37, 6 March 2009 by Jeb (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

net.createDevice(isPrimitive)

Creates a new network device which can be used to connect with or host games.

There are currently two types of network devices, the Daisy device and the "primitive" device. The Daisy device is used when you want to send Lua table data as game packets. The device will also perform a simple hand-shake check when a client connets, verifying that the client has the same game version as the host and that the host isn't full.

The "primitive" device is used when you want to control the network data yourself. This device doesn't support the "sendPacket" methods, but use the "sendData" instead. This device is used when, for example, you are transmitting using traditional protocols such as HTTP or IRC.

Parameter Expected Type Description
isPrimitive A boolean Set this to true to get a "primitive" device.
Returns

The method returns a Lunamatic reference to a network device.

Daisymoon Network Lib

Example

   local myDevice = net.createDevice(false)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox