52 lines
1.4 KiB
Plaintext
52 lines
1.4 KiB
Plaintext
|
LuaDistributesRetGetTopTenWeddingData = {}
|
||
|
|
||
|
LuaDistributesRetGetTopTenWeddingData.sysID = 42
|
||
|
LuaDistributesRetGetTopTenWeddingData.cmdID = 2
|
||
|
|
||
|
function LuaDistributesRetGetTopTenWeddingData.ExtraPacket(memStream)
|
||
|
-- print('ExtraPacket:'..memStream.Length)
|
||
|
|
||
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
||
|
local sysID = binaryReader:ReadByte()
|
||
|
local cmdID = binaryReader:ReadByte()
|
||
|
packet = LuaDistributesRetGetTopTenWeddingData.ReadPacket(binaryReader)
|
||
|
|
||
|
return packet
|
||
|
end
|
||
|
|
||
|
function LuaDistributesRetGetTopTenWeddingData.SendPacket(packet)
|
||
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesRetGetTopTenWeddingData.sysID, LuaDistributesRetGetTopTenWeddingData.cmdID)
|
||
|
if(packet['myBestRanking'] == nil) then
|
||
|
packet['myBestRanking'] = 0
|
||
|
end
|
||
|
message:WriteInt(packet['myBestRanking'])
|
||
|
|
||
|
if(marryInfo == nil) then
|
||
|
marryInfo = {}
|
||
|
end
|
||
|
message:WriteInt(#packet['marryInfo'])
|
||
|
for k,v in ipairs(packet['marryInfo']) do
|
||
|
require "LuaDistributesMarryInfo"
|
||
|
LuaDistributesMarryInfo.WritePacket(v, binaryWriter)
|
||
|
|
||
|
end
|
||
|
|
||
|
|
||
|
message:Send()
|
||
|
end
|
||
|
|
||
|
function LuaDistributesRetGetTopTenWeddingData.ReadPacket(binaryReader)
|
||
|
|
||
|
local packet = {}
|
||
|
packet['myBestRanking'] = binaryReader:ReadInt32()
|
||
|
|
||
|
packet['marryInfo'] = {}
|
||
|
local marryInfoCnt = binaryReader:ReadInt32()
|
||
|
for i=1,marryInfoCnt,1 do
|
||
|
require "LuaDistributesMarryInfo"
|
||
|
packet['marryInfo'][i] = LuaDistributesMarryInfo.ReadPacket(binaryReader)
|
||
|
|
||
|
end
|
||
|
|
||
|
return packet
|
||
|
end
|