initial commit
This commit is contained in:
+42
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Crysome.Common.Network.Packets.Client;
|
||||
|
||||
public class CameraDevicesResponsePacket : IPacket
|
||||
{
|
||||
public string[] DeviceNames { get; set; } = Array.Empty<string>();
|
||||
|
||||
public CameraDevicesResponsePacket()
|
||||
{
|
||||
}
|
||||
|
||||
public CameraDevicesResponsePacket(string[] names)
|
||||
{
|
||||
DeviceNames = names ?? Array.Empty<string>();
|
||||
}
|
||||
|
||||
public void Write(BinaryWriter w)
|
||||
{
|
||||
string[] deviceNames = DeviceNames;
|
||||
w.Write((deviceNames != null) ? deviceNames.Length : 0);
|
||||
if (DeviceNames != null)
|
||||
{
|
||||
string[] deviceNames2 = DeviceNames;
|
||||
foreach (string text in deviceNames2)
|
||||
{
|
||||
w.Write(text ?? "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Read(BinaryReader r)
|
||||
{
|
||||
int num = r.ReadInt32();
|
||||
DeviceNames = new string[num];
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
DeviceNames[i] = r.ReadString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user