using System.IO;

namespace Crysome.Common.Network.Packets.Client;

public class WriteFileResponsePacket : IPacket
{
	public bool Success { get; set; }

	public string ErrorMessage { get; set; }

	public long TransferId { get; set; }

	public void Write(BinaryWriter w)
	{
		w.Write(Success);
		w.Write(ErrorMessage ?? "");
		w.Write(TransferId);
	}

	public void Read(BinaryReader r)
	{
		Success = r.ReadBoolean();
		ErrorMessage = r.ReadString();
		TransferId = r.ReadInt64();
	}
}
