delphi大佬来帮帮萌新吧
这个是客户端退出后,再上线人物包裹物品不是退出时的位置,怎么才可以让人物上线后包裹物品还是下线前的顺序我把所有关联代码都贴出来,望大佬指点指点,感激不尽
-------------------------------------------------------------------------------------------
CM_BAGORDER: begin //人物下线之前保存的数据
ClientSetBagOrder(ProcessMsg.wParam, ProcessMsg.sMsg);
end;
--------------------------------------------------------------------------------------
{客户端发送的包裹顺序}
procedure TPlayObject.ClientSetBagOrder(nItemCount: Integer; sData: string);
var
BagItemOrder : array of TClientItemOrder;
i, ii : Integer;
begin
if m_boPneuma then Exit; //元神不发送
if nItemCount > 125 then
nItemCount := 125;
DeCodeBuffer(sData, @BagItemOrder, nItemCount * SizeOf(TClientItemOrder));
for i := 0 to nItemCount - 1 do begin
ii := m_ItemList.IndexOf(BagItemOrder.MakeIndex);
if ii >= 0 then
m_ItemList.Pos := BagItemOrder.Order;
end;
end;
-----------------------------------------------------------------------------------------------------------------------
//把包裹顺序发送到客户端
procedure TPlayObject.ClientSendBagOrder();
var
BagOrder : array 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;
BagOrder.MakeIndex := UserItem.MakeIndex;
BagOrder.Order := m_ItemList.Pos;
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, m_ItemList.Count * SizeOf(TClientItemOrder)));
end; 现在搞delphi的人很少,基本没人看。你还不如去贴吧看看 心驰神往 发表于 2021-11-23 11:43
现在搞delphi的人很少,基本没人看。你还不如去贴吧看看
谢谢
页:
[1]