Difference between revisions of "ServerObject:setCallback"
(Created page with 'Connect to a server. == Function == === Synopsis === <source lang="lua"> clientobject:init( sockettype ) </source> === Arguments === {{param|SocketType|string|"tcp", "udp" or use…') |
Simonlarsen (talk | contribs) m (changed setCallbacks to setCallback) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | Sets the callbacks for the server. | |
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | server:setCallback(receive, connect, disconnect) | |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param| | + | {{param|function|receive|Callback called on incoming data(filtered): function(data, id).}} |
+ | {{param|function|connect|Callback called when client(s) connect: function(id).}} | ||
+ | {{param|function|disconnect|Callback called when client(s) disconnect (also called by ping): function(id).}} | ||
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
Line 12: | Line 14: | ||
* [[parent::ServerObject]] | * [[parent::ServerObject]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description= | + | {{#set:Description=Sets the callbacks for the server.}} |
== Other Languages == | == Other Languages == | ||
− | {{i18n|ServerObject: | + | {{i18n|ServerObject:setCallback}} |
Latest revision as of 23:26, 23 June 2011
Sets the callbacks for the server.
Function
Synopsis
server:setCallback(receive, connect, disconnect)
Arguments
function receive
- Callback called on incoming data(filtered): function(data, id).
function connect
- Callback called when client(s) connect: function(id).
function disconnect
- Callback called when client(s) disconnect (also called by ping): function(id).
Returns
Nothing.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info