45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
LuaDistributesChildrenAttr = {}
|
|
|
|
LuaDistributesChildrenAttr.sysID = 0
|
|
LuaDistributesChildrenAttr.cmdID = 0
|
|
|
|
function LuaDistributesChildrenAttr.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesChildrenAttr.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesChildrenAttr.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesChildrenAttr.sysID, LuaDistributesChildrenAttr.cmdID)
|
|
if(attrList == nil) then
|
|
attrList = {}
|
|
end
|
|
message:WriteInt(#packet['attrList'])
|
|
for k,v in ipairs(packet['attrList']) do
|
|
require "LuaDistributesAttrData"
|
|
LuaDistributesAttrData.WritePacket(v, binaryWriter)
|
|
|
|
end
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesChildrenAttr.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['attrList'] = {}
|
|
local attrListCnt = binaryReader:ReadInt32()
|
|
for i=1,attrListCnt,1 do
|
|
require "LuaDistributesAttrData"
|
|
packet['attrList'][i] = LuaDistributesAttrData.ReadPacket(binaryReader)
|
|
|
|
end
|
|
|
|
return packet
|
|
end |