using System.IO;

namespace Crysome.Common.Network.Packets.Client;

public class GetSystemInfoResponsePacket : IPacket
{
	public string Identifier { get; set; }

	public string Address { get; set; }

	public int Port { get; set; }

	public string Username { get; set; }

	public string ComputerName { get; set; }

	public string OS { get; set; }

	public GetSystemInfoResponsePacket()
	{
	}

	public GetSystemInfoResponsePacket(string identifier, string address, int port, string username, string computerName, string os)
	{
		Identifier = identifier;
		Address = address;
		Port = port;
		Username = username;
		ComputerName = computerName;
		OS = os;
	}

	public void Write(BinaryWriter w)
	{
		w.Write(Identifier ?? "");
		w.Write(Address ?? "");
		w.Write(Port);
		w.Write(Username ?? "");
		w.Write(ComputerName ?? "");
		w.Write(OS ?? "");
	}

	public void Read(BinaryReader r)
	{
		Identifier = r.ReadString();
		Address = r.ReadString();
		Port = r.ReadInt32();
		Username = r.ReadString();
		ComputerName = r.ReadString();
		OS = r.ReadString();
	}
}
