This repository has been archived on 2019-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2016-11-12 11:33:10 +00:00
|
|
|
|
namespace Galactic_Colors_Control_Common.Protocol
|
|
|
|
|
{
|
2016-11-13 00:26:03 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Client to Server Data request packet 'allways' return ResultData
|
|
|
|
|
/// </summary>
|
2016-11-12 11:33:10 +00:00
|
|
|
|
public class RequestData : Data
|
|
|
|
|
{
|
2016-11-13 00:26:03 +00:00
|
|
|
|
public int id; //Client Size autoindent id
|
2016-11-12 11:33:10 +00:00
|
|
|
|
public string[] args;
|
|
|
|
|
|
2016-11-13 00:26:03 +00:00
|
|
|
|
public RequestData(int Id, string[] Args)
|
2016-11-12 11:33:10 +00:00
|
|
|
|
{
|
2016-11-13 00:26:03 +00:00
|
|
|
|
id = Id;
|
|
|
|
|
args = Args;
|
2016-11-12 11:33:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RequestData(ref byte[] bytes)
|
|
|
|
|
{
|
|
|
|
|
id = Binary.ToInt(ref bytes);
|
|
|
|
|
args = Binary.ToStringArray(ref bytes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override byte[] ToBytes()
|
|
|
|
|
{
|
|
|
|
|
return Binary.AddBytes(Binary.FromInt((int)DataType.Request), Binary.FromInt(id), Binary.FromStringArray(args));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToSmallString()
|
|
|
|
|
{
|
|
|
|
|
return Common.ArrayToString(args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToLongString()
|
|
|
|
|
{
|
|
|
|
|
return "Request : " + Common.ArrayToString(args) + "|" + id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|