63 lines
1.5 KiB
Plaintext
63 lines
1.5 KiB
Plaintext
LuaDistributesValhallaAvatarReq = {}
|
|
|
|
LuaDistributesValhallaAvatarReq.sysID = 46
|
|
LuaDistributesValhallaAvatarReq.cmdID = 12
|
|
|
|
function LuaDistributesValhallaAvatarReq.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesValhallaAvatarReq.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesValhallaAvatarReq.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesValhallaAvatarReq.sysID, LuaDistributesValhallaAvatarReq.cmdID)
|
|
if(packet['drawType'] == nil) then
|
|
packet['drawType'] = 0
|
|
end
|
|
message:WriteInt(packet['drawType'])
|
|
|
|
if(packet['count'] == nil) then
|
|
packet['count'] = 0
|
|
end
|
|
message:WriteInt(packet['count'])
|
|
|
|
if(packet['untilMax'] == nil) then
|
|
packet['untilMax'] = 0
|
|
end
|
|
message:WriteByte(packet['untilMax'])
|
|
|
|
if(packet['autoBuy'] == nil) then
|
|
packet['autoBuy'] = 0
|
|
end
|
|
message:WriteByte(packet['autoBuy'])
|
|
|
|
if(packet['untilOrange'] == nil) then
|
|
packet['untilOrange'] = 0
|
|
end
|
|
message:WriteByte(packet['untilOrange'])
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesValhallaAvatarReq.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['drawType'] = binaryReader:ReadInt32()
|
|
|
|
packet['count'] = binaryReader:ReadInt32()
|
|
|
|
packet['untilMax'] = binaryReader:ReadByte()
|
|
|
|
packet['autoBuy'] = binaryReader:ReadByte()
|
|
|
|
packet['untilOrange'] = binaryReader:ReadByte()
|
|
|
|
|
|
return packet
|
|
end |