2014-07-08 05:58:53 -07:00
|
|
|
|
using ProtoBuf;
|
2015-06-05 14:07:37 -07:00
|
|
|
|
using xServer.Core.Networking;
|
2014-07-08 05:58:53 -07:00
|
|
|
|
|
2015-01-13 10:29:11 -08:00
|
|
|
|
namespace xServer.Core.Packets.ClientPackets
|
2014-07-08 05:58:53 -07:00
|
|
|
|
{
|
|
|
|
|
[ProtoContract]
|
|
|
|
|
public class DownloadFileResponse : IPacket
|
|
|
|
|
{
|
|
|
|
|
[ProtoMember(1)]
|
2015-04-04 08:22:20 -07:00
|
|
|
|
public int ID { get; set; }
|
2014-07-08 05:58:53 -07:00
|
|
|
|
|
|
|
|
|
[ProtoMember(2)]
|
2015-04-04 08:22:20 -07:00
|
|
|
|
public string Filename { get; set; }
|
2014-07-08 05:58:53 -07:00
|
|
|
|
|
|
|
|
|
[ProtoMember(3)]
|
2015-04-04 08:22:20 -07:00
|
|
|
|
public byte[] Block { get; set; }
|
|
|
|
|
|
|
|
|
|
[ProtoMember(4)]
|
|
|
|
|
public int MaxBlocks { get; set; }
|
|
|
|
|
|
|
|
|
|
[ProtoMember(5)]
|
|
|
|
|
public int CurrentBlock { get; set; }
|
|
|
|
|
|
|
|
|
|
[ProtoMember(6)]
|
|
|
|
|
public string CustomMessage { get; set; }
|
2014-07-08 05:58:53 -07:00
|
|
|
|
|
2015-04-21 11:27:52 -07:00
|
|
|
|
public DownloadFileResponse()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DownloadFileResponse(int id, string filename, byte[] block, int maxblocks, int currentblock,
|
|
|
|
|
string custommessage)
|
2014-07-08 05:58:53 -07:00
|
|
|
|
{
|
|
|
|
|
this.ID = id;
|
2015-04-04 08:22:20 -07:00
|
|
|
|
this.Filename = filename;
|
|
|
|
|
this.Block = block;
|
|
|
|
|
this.MaxBlocks = maxblocks;
|
|
|
|
|
this.CurrentBlock = currentblock;
|
|
|
|
|
this.CustomMessage = custommessage;
|
2014-07-08 05:58:53 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Execute(Client client)
|
|
|
|
|
{
|
2015-05-18 18:01:38 -07:00
|
|
|
|
client.Send(this);
|
2014-07-08 05:58:53 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|