56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
namespace LSServerService
|
|
{
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack=1)]
|
|
public struct C2S_DownloadFile
|
|
{
|
|
public const uint ID = 19;
|
|
public MsgHeader header;
|
|
public int dwDirectoryId;
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst=50)]
|
|
public int[] dwFileIds;
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst=50)]
|
|
public int[] dwProductIds;
|
|
public C2S_DownloadFile(bool autoSet)
|
|
{
|
|
this.header = new MsgHeader();
|
|
this.dwDirectoryId = 0;
|
|
this.dwFileIds = new int[50];
|
|
this.dwProductIds = new int[50];
|
|
this.header.dwType = 19;
|
|
this.header.dwLen = (uint) Marshal.SizeOf(this);
|
|
}
|
|
|
|
public string strFileIds
|
|
{
|
|
get
|
|
{
|
|
return this.getIds(this.dwFileIds);
|
|
}
|
|
}
|
|
public string strProductIds
|
|
{
|
|
get
|
|
{
|
|
return this.getIds(this.dwProductIds);
|
|
}
|
|
}
|
|
private string getIds(int[] arr)
|
|
{
|
|
string str = "";
|
|
for (int i = 0; i < arr.Length; i++)
|
|
{
|
|
int num2 = arr[i];
|
|
if (num2 != 0)
|
|
{
|
|
str = str + num2.ToString() + "|";
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
}
|
|
}
|
|
|