/// <summary> /// Creates a new <see cref="DicePacketEventArgs"/> instance with the delivered <see cref="IDicePacket"/> information /// </summary> /// <param name="packet"></param> public DicePacketEventArgs(IDicePacket packet) { #region Contracts if (packet == null) { throw new ArgumentNullException("packet"); } #endregion Packet = packet; }
/// <summary> /// Sends a DICE <see cref="IDicePacket"/> to the RCon interface /// </summary> /// <param name="words"></param> /// <returns></returns> public virtual async Task<int> SendAsync(IDicePacket packet) { return await this.Socket.SendAsync(new SocketData(packet.ToBytes())); }
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public bool Equals(IDicePacket other) { if (other == null) return false; return Equals(Sequence, other.Sequence) && words.SequenceEqual(other.Words); }