public void ParseMsg(UInt16 msgId, MemoryStream stream) { //Debug.Log("ParseMsg:" + msgId); if (!NFCNetDispatcher.Instance().dispatchMessage(msgId, stream)) { //var xMsg = Serializer.Deserialize<NFMsg.MsgBase>(stream); byte[] byteArray = new byte[stream.Length]; stream.Read(byteArray, 0, byteArray.Length); //AddEvent(msgId, luaByteBuf); OnLuaDispatch(msgId, byteArray); //ProtoFactory.Recycle(xMsg); } }
public void AddReceiveCallBack(UInt16 id, NFCMessageDispatcher.MessageHandler netHandler) { NFCNetDispatcher.Instance().AddReceiveCallBack((UInt16)id, netHandler); }