lobby.sendPacket
Prototype
public function sendPacket(
Input parameters
packettype - type of the packet to send
data - associative array object with data to send
Return value
null
Description
Sends a data packet to the server. The objects that can be sent is any array object, containing numbers, strings or other array objects. Associated with every packet sent is a packet type, this is a positive integer defined by the programmer.
Example code
// Construct a network packet with the answer and send to the server
var packetData = {"answer":answer};
lobby.sendPacket(PACK_ANSWER, packetData);
