Files
JJBB/Assets/Project/Script/LuaScripts/NetWork/Lua/Distributes/LuaDistributesChindrenSkill.txt

98 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-08-23 15:49:34 +08:00
LuaDistributesChindrenSkill = {}
LuaDistributesChindrenSkill.sysID = 0
LuaDistributesChindrenSkill.cmdID = 0
function LuaDistributesChindrenSkill.ExtraPacket(memStream)
-- print('ExtraPacket:'..memStream.Length)
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
local sysID = binaryReader:ReadByte()
local cmdID = binaryReader:ReadByte()
packet = LuaDistributesChindrenSkill.ReadPacket(binaryReader)
return packet
end
function LuaDistributesChindrenSkill.SendPacket(packet)
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesChindrenSkill.sysID, LuaDistributesChindrenSkill.cmdID)
if(packet['curLvlMath'] == nil) then
packet['curLvlMath'] = 0
end
message:WriteInt(packet['curLvlMath'])
if(packet['curExpMath'] == nil) then
packet['curExpMath'] = 0
end
message:WriteInt(packet['curExpMath'])
if(packet['curLvlArt'] == nil) then
packet['curLvlArt'] = 0
end
message:WriteInt(packet['curLvlArt'])
if(packet['curExpArt'] == nil) then
packet['curExpArt'] = 0
end
message:WriteInt(packet['curExpArt'])
if(packet['curLvlWarcraft'] == nil) then
packet['curLvlWarcraft'] = 0
end
message:WriteInt(packet['curLvlWarcraft'])
if(packet['curExpWarcraft'] == nil) then
packet['curExpWarcraft'] = 0
end
message:WriteInt(packet['curExpWarcraft'])
if(packet['curLvlStamina'] == nil) then
packet['curLvlStamina'] = 0
end
message:WriteInt(packet['curLvlStamina'])
if(packet['curExpStamina'] == nil) then
packet['curExpStamina'] = 0
end
message:WriteInt(packet['curExpStamina'])
if(packet['studyingType'] == nil) then
packet['studyingType'] = 0
end
message:WriteInt(packet['studyingType'])
if(packet['studyingEndtime'] == nil) then
packet['studyingEndtime'] = 0
end
message:WriteInt(packet['studyingEndtime'])
message:Send()
end
function LuaDistributesChindrenSkill.ReadPacket(binaryReader)
local packet = {}
packet['curLvlMath'] = binaryReader:ReadInt32()
packet['curExpMath'] = binaryReader:ReadInt32()
packet['curLvlArt'] = binaryReader:ReadInt32()
packet['curExpArt'] = binaryReader:ReadInt32()
packet['curLvlWarcraft'] = binaryReader:ReadInt32()
packet['curExpWarcraft'] = binaryReader:ReadInt32()
packet['curLvlStamina'] = binaryReader:ReadInt32()
packet['curExpStamina'] = binaryReader:ReadInt32()
packet['studyingType'] = binaryReader:ReadInt32()
packet['studyingEndtime'] = binaryReader:ReadInt32()
return packet
end