procedure TPlayObject.ClientSetBagOrder(nItemCount: Integer; sData: string);
var
BagItemOrder : array[0..125] of TClientItemOrder;
i, ii : Integer;
begin
if m_boPneuma then Exit; //元神不发送
if nItemCount > 125 then
nItemCount := 125;
DeCodeBuffer(sData, @BagItemOrder[0], nItemCount * SizeOf(TClientItemOrder));
for i := 0 to nItemCount - 1 do begin
ii := m_ItemList.IndexOf(BagItemOrder[i].MakeIndex);
if ii >= 0 then
m_ItemList.Pos[ii] := BagItemOrder[i].Order;
end;
end;
-----------------------------------------------------------------------------------------------------------------------
//把包裹顺序发送到客户端
procedure TPlayObject.ClientSendBagOrder();
var
BagOrder : array[0..125] of TClientItemOrder;
i : Integer;
sData : string;
UserItem : pTUserItem;
bo : Boolean;
begin
if m_boPneuma then Exit; //元神不发送
for i := 0 to m_ItemList.Count - 1 do begin
UserItem := m_ItemList.Items[i];
BagOrder[i].MakeIndex := UserItem.MakeIndex;
BagOrder[i].Order := m_ItemList.Pos[i];
if i >= 125 then
Break;
end;
m_defMsg := MakeDefaultMsg($46, 0, 0, 0, m_ItemList.Count);
if m_ItemList.Count <> 0 then
SendSocket(@m_defMsg, EnCodeBuffer(@BagOrder[0], m_ItemList.Count * SizeOf(TClientItemOrder)));
end;