| msgType | Message type number. |
| handler | Function handler which will be invoked for when this message type is received. |
Register a handler for a particular message type.
There are several system message types which you can add handlers for. You can also add your own message types.
import Networking;
function Start() { NetworkServer.Instance.Listen(7070); Debug.Log ("Registering server callbacks"); NetworkServer.Instance.RegisterHandler(MsgType.SYSTEM_CONNECT, OnConnected); }
function OnConnected(conn : NetworkConnection, reader : NetworkReader) { Debug.Log ("Client connected"); }
no example available in C#