59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
LuaDistributesMillionPowerInfoRsp = {}
|
|
|
|
LuaDistributesMillionPowerInfoRsp.sysID = 55
|
|
LuaDistributesMillionPowerInfoRsp.cmdID = 3
|
|
|
|
function LuaDistributesMillionPowerInfoRsp.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesMillionPowerInfoRsp.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesMillionPowerInfoRsp.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesMillionPowerInfoRsp.sysID, LuaDistributesMillionPowerInfoRsp.cmdID)
|
|
if(packet['activityDay'] == nil) then
|
|
packet['activityDay'] = 0
|
|
end
|
|
message:WriteInt(packet['activityDay'])
|
|
|
|
if(packet['endDesc'] == nil) then
|
|
packet['endDesc'] = ""
|
|
end
|
|
message:WriteString(packet['endDesc'])
|
|
|
|
if(millionTaskList == nil) then
|
|
millionTaskList = {}
|
|
end
|
|
message:WriteInt(#packet['millionTaskList'])
|
|
for k,v in ipairs(packet['millionTaskList']) do
|
|
require "LuaDistributesMillionTaskState"
|
|
LuaDistributesMillionTaskState.WritePacket(v, binaryWriter)
|
|
|
|
end
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesMillionPowerInfoRsp.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['activityDay'] = binaryReader:ReadInt32()
|
|
|
|
packet['endDesc'] = CS.BinaryMessageHandle.ReadString(binaryReader)
|
|
|
|
packet['millionTaskList'] = {}
|
|
local millionTaskListCnt = binaryReader:ReadInt32()
|
|
for i=1,millionTaskListCnt,1 do
|
|
require "LuaDistributesMillionTaskState"
|
|
packet['millionTaskList'][i] = LuaDistributesMillionTaskState.ReadPacket(binaryReader)
|
|
|
|
end
|
|
|
|
return packet
|
|
end |