2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-05-06 19:42:58 +00:00

Bulk support removed

This commit is contained in:
Ahmed Zamil 2019-11-20 15:22:28 +03:00
parent 7de6354857
commit 5c995a7def

View File

@ -150,12 +150,6 @@ namespace Esiur.Net.Packets
set; set;
} }
public bool Bulk
{
get;
set;
}
public IIPPacketEvent Event public IIPPacketEvent Event
{ {
get; get;
@ -180,12 +174,12 @@ namespace Esiur.Net.Packets
} }
public uint[] ResourcesIds { get; set; } //public uint[] ResourcesIds { get; set; }
public uint NewResourcesIds { get; set; } //public uint NewResourcesIds { get; set; }
public uint ChildrenIds { get; set; } //public uint ChildrenIds { get; set; }
public uint StoresIds { get; set; } //public uint StoresIds { get; set; }
public IIPPacketAttachInfo[] AttachReply { get; set; } //public IIPPacketAttachInfo[] AttachReply { get; set; }
public uint ResourceId { get; set; } public uint ResourceId { get; set; }
public uint NewResourceId { get; set; } public uint NewResourceId { get; set; }
@ -266,7 +260,7 @@ namespace Esiur.Net.Packets
{ {
PreviousAction = Action; PreviousAction = Action;
Action = (IIPPacketAction)(data[offset] & 0x1f); Action = (IIPPacketAction)(data[offset] & 0x1f);
Bulk = (data[offset++] & 0x20) == 0x20; //Bulk = (data[offset++] & 0x20) == 0x20;
if (NotEnough(offset, ends, 4)) if (NotEnough(offset, ends, 4))
return -dataLengthNeeded; return -dataLengthNeeded;
@ -384,7 +378,7 @@ namespace Esiur.Net.Packets
if (NotEnough(offset, ends, 4)) if (NotEnough(offset, ends, 4))
return -dataLengthNeeded; return -dataLengthNeeded;
if (Bulk) /*if (Bulk)
{ {
var cl = data.GetUInt32(offset); var cl = data.GetUInt32(offset);
offset += 4; offset += 4;
@ -394,7 +388,7 @@ namespace Esiur.Net.Packets
ResourcesIds = data.GetUInt32Array(offset, cl); ResourcesIds = data.GetUInt32Array(offset, cl);
} }
else else*/
{ {
ResourceId = data.GetUInt32(offset); ResourceId = data.GetUInt32(offset);
offset += 4; offset += 4;
@ -654,8 +648,8 @@ namespace Esiur.Net.Packets
|| Action == IIPPacketAction.ReattachResource) || Action == IIPPacketAction.ReattachResource)
{ {
if (Bulk) //if (!Bulk)
{ //{
if (NotEnough(offset, ends, 26)) if (NotEnough(offset, ends, 26))
return -dataLengthNeeded; return -dataLengthNeeded;
@ -685,43 +679,43 @@ namespace Esiur.Net.Packets
Content = data.Clip(offset, cl); Content = data.Clip(offset, cl);
offset += cl; offset += cl;
} //}
else //else
{ //{
// length // // length
if (NotEnough(offset, ends, 4)) // if (NotEnough(offset, ends, 4))
return -dataLengthNeeded; // return -dataLengthNeeded;
var cl = data.GetUInt32(offset); // var cl = data.GetUInt32(offset);
offset += 4; // offset += 4;
if (NotEnough(offset, ends, cl)) // if (NotEnough(offset, ends, cl))
return -dataLengthNeeded; // return -dataLengthNeeded;
// Content = data.Clip(offset, cl); // // Content = data.Clip(offset, cl);
//offset += cl; // //offset += cl;
cl += offset; // cl += offset;
var list = new List<IIPPacketAttachInfo>(); // var list = new List<IIPPacketAttachInfo>();
while(offset < cl) // while(offset < cl)
{ // {
Guid classId = data.GetGuid(offset); // Guid classId = data.GetGuid(offset);
offset += 16; // offset += 16;
ulong age = data.GetUInt64(offset); // ulong age = data.GetUInt64(offset);
offset += 8; // offset += 8;
var len = data.GetUInt16(offset); // var len = data.GetUInt16(offset);
offset += 2; // offset += 2;
var link = data.GetString(offset, len); // var link = data.GetString(offset, len);
offset += len; // offset += len;
var cc = data.GetUInt32(offset); // var cc = data.GetUInt32(offset);
list.Add(new IIPPacketAttachInfo(classId, age, link, data.Clip(offset, cc))); // list.Add(new IIPPacketAttachInfo(classId, age, link, data.Clip(offset, cc)));
offset += cc; // offset += cc;
} // }
AttachReply = list.ToArray(); //AttachReply = list.ToArray();
} //}
} }
else if (Action == IIPPacketAction.DetachResource) else if (Action == IIPPacketAction.DetachResource)
{ {