77 lines
1.8 KiB
Plaintext
77 lines
1.8 KiB
Plaintext
LuaDistributesChildrenInteract = {}
|
|
|
|
LuaDistributesChildrenInteract.sysID = 0
|
|
LuaDistributesChildrenInteract.cmdID = 0
|
|
|
|
function LuaDistributesChildrenInteract.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesChildrenInteract.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesChildrenInteract.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesChildrenInteract.sysID, LuaDistributesChildrenInteract.cmdID)
|
|
if(packet['curSatiety'] == nil) then
|
|
packet['curSatiety'] = 0
|
|
end
|
|
message:WriteInt(packet['curSatiety'])
|
|
|
|
if(packet['curClean'] == nil) then
|
|
packet['curClean'] = 0
|
|
end
|
|
message:WriteInt(packet['curClean'])
|
|
|
|
if(packet['curHealth'] == nil) then
|
|
packet['curHealth'] = 0
|
|
end
|
|
message:WriteInt(packet['curHealth'])
|
|
|
|
if(packet['curMood'] == nil) then
|
|
packet['curMood'] = 0
|
|
end
|
|
message:WriteInt(packet['curMood'])
|
|
|
|
if(packet['expectExp'] == nil) then
|
|
packet['expectExp'] = 0
|
|
end
|
|
message:WriteInt(packet['expectExp'])
|
|
|
|
if(packet['remainTimes'] == nil) then
|
|
packet['remainTimes'] = 0
|
|
end
|
|
message:WriteInt(packet['remainTimes'])
|
|
|
|
if(packet['remainResetTime'] == nil) then
|
|
packet['remainResetTime'] = 0
|
|
end
|
|
message:WriteInt(packet['remainResetTime'])
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesChildrenInteract.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['curSatiety'] = binaryReader:ReadInt32()
|
|
|
|
packet['curClean'] = binaryReader:ReadInt32()
|
|
|
|
packet['curHealth'] = binaryReader:ReadInt32()
|
|
|
|
packet['curMood'] = binaryReader:ReadInt32()
|
|
|
|
packet['expectExp'] = binaryReader:ReadInt32()
|
|
|
|
packet['remainTimes'] = binaryReader:ReadInt32()
|
|
|
|
packet['remainResetTime'] = binaryReader:ReadInt32()
|
|
|
|
|
|
return packet
|
|
end |