Difference between revisions of "enet.event"

(Description)
m (Description: - fixed minor word error. One can be weary after an exhausting day, but one should be wary of wherewolfes...)
Line 2: Line 2:
 
An [[enet.event | event]] is a table generated by [[enet.host:service | host:service()]] or [[enet.peer:receive | peer:recieve()]] which will '''always''' contain a [[string]] named ''type'', a [[enet.peer]] named ''peer'', and a [[string]] or [[number]] named ''data'' depending on the kind of event.
 
An [[enet.event | event]] is a table generated by [[enet.host:service | host:service()]] or [[enet.peer:receive | peer:recieve()]] which will '''always''' contain a [[string]] named ''type'', a [[enet.peer]] named ''peer'', and a [[string]] or [[number]] named ''data'' depending on the kind of event.
  
Though be weary that [[enet.host:service | host:service()]] and [[enet.peer:receive | peer:recieve()]] can return [[nil]] if no events are in the queue.
+
Though be wary that [[enet.host:service | host:service()]] and [[enet.peer:receive | peer:recieve()]] can return [[nil]] if no events are in the queue.
  
 
== Structure ==
 
== Structure ==

Revision as of 22:26, 26 October 2016

Description

An event is a table generated by host:service() or peer:recieve() which will always contain a string named type, a enet.peer named peer, and a string or number named data depending on the kind of event.

Though be wary that host:service() and peer:recieve() can return nil if no events are in the queue.

Structure

event.type event.peer event.data
"receive" peer string
"disconnect" peer number
"connect" peer number

See Also