public void ReadPacket(byte[] data, object link) { try { if (data.Length > 0) { GetCallbackFromData(data)(data, link); } } catch (Exception) { Console.WriteLine("Empty data in Processor"); } }
/// <summary> /// Reads one packet from NetDataReader and calls OnReceive delegate /// </summary> /// <param name="reader">NetDataReader with packet</param> /// <param name="userData">Argument that passed to OnReceivedEvent</param> /// <exception cref="ParseException">Malformed packet</exception> public void ReadPacket(NetDataReader reader, object userData) { GetCallbackFromData(reader)(reader, userData); }