/// <summary> /// Writes the packet. /// </summary> /// <param name="stream"> The stream. </param> /// <param name="packet"> The packet. </param> /// <param name="version"> The version. </param> /// <remarks> /// </remarks> public static void WritePacket(this BigEndianStream stream, Packet packet, int version) { if (packet == null) throw new ArgumentNullException("packet"); packet.SendItem(stream, version); }
/// <summary> /// Sends the packet. /// </summary> /// <param name="packet"> The packet. </param> /// <param name="stream"> The stream. </param> /// <param name="version"> The version. </param> /// <param name="requiredVersion"> The required version. </param> /// <param name="lastSupportedVersion"> The last supported version. </param> /// <param name="throwOnRequired"> if set to <c>true</c> [throw on required]. </param> /// <param name="throwOnLast"> if set to <c>true</c> [throw on last]. </param> /// <remarks> /// </remarks> public static void SendPacket(Packet packet, BigEndianStream stream, int version, int requiredVersion, int lastSupportedVersion, bool throwOnRequired, bool throwOnLast) { bool supported = CheckPacket(packet, version, requiredVersion, lastSupportedVersion, throwOnRequired, throwOnLast); if (!supported) return; packet.SendItem(stream, version); }