public static Task WritePacketAsync(this BigEndianStream stream, Packet packet, int version) { if (packet == null) throw new ArgumentNullException("packet"); return packet.SendItemAsync(stream, version); }
public static async Task SendPacketAsync(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; await packet.SendItemAsync(stream, version); }