Files

43 lines
687 B
C#
Raw Permalink Normal View History

2026-08-27 11:22:54 -06:00
using System.IO;
namespace Crysome.Common.Network.Packets.Server;
public class RequestAudioPacket : IPacket
{
public int Seconds { get; set; } = 5;
public int DeviceIndex { get; set; }
public RequestAudioPacket()
{
}
public RequestAudioPacket(int seconds, int deviceIndex = 0)
{
Seconds = seconds;
DeviceIndex = deviceIndex;
}
public void Write(BinaryWriter w)
{
w.Write(Seconds);
w.Write(DeviceIndex);
}
public void Read(BinaryReader r)
{
Seconds = r.ReadInt32();
try
{
if (r.BaseStream.Position < r.BaseStream.Length)
{
DeviceIndex = r.ReadInt32();
}
}
catch
{
DeviceIndex = 0;
}
}
}