/// <summary> /// Creates a new network packet, inheriting data from an existing one. /// </summary> /// <param name="packet">The packet.</param> /// <param name="offset">The offset.</param> public NetworkPacket(NetworkPacket packet, int offset = 0) : this(packet._buffer, offset) { }
/// <summary> /// Logs the packet. /// </summary> /// <param name="packet">The packet to log.</param> /// <param name="logBody">If set to true the body of the packet is logged too.</param> /// <param name="logSub">If set to true the sub type of the packet is logged too.</param> /// <param name="subObject">The object associated with the sub type.</param> public void LogPacket(NetworkPacket packet, bool logBody, bool logSub = false, object subObject = null) { #if LOCAL PacketLogger.Log(packet, logBody, logSub, subObject); #endif }