63 lines
1.4 KiB
Plaintext
63 lines
1.4 KiB
Plaintext
LuaDistributesValhallaFacility = {}
|
|
|
|
LuaDistributesValhallaFacility.sysID = 0
|
|
LuaDistributesValhallaFacility.cmdID = 0
|
|
|
|
function LuaDistributesValhallaFacility.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesValhallaFacility.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesValhallaFacility.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesValhallaFacility.sysID, LuaDistributesValhallaFacility.cmdID)
|
|
if(packet['id'] == nil) then
|
|
packet['id'] = 0
|
|
end
|
|
message:WriteInt(packet['id'])
|
|
|
|
if(packet['level'] == nil) then
|
|
packet['level'] = 0
|
|
end
|
|
message:WriteInt(packet['level'])
|
|
|
|
if(packet['upgTime'] == nil) then
|
|
packet['upgTime'] = 0
|
|
end
|
|
message:WriteInt(packet['upgTime'])
|
|
|
|
if(packet['pdtTime'] == nil) then
|
|
packet['pdtTime'] = 0
|
|
end
|
|
message:WriteInt(packet['pdtTime'])
|
|
|
|
if(packet['pdtCount'] == nil) then
|
|
packet['pdtCount'] = 0
|
|
end
|
|
message:WriteInt(packet['pdtCount'])
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesValhallaFacility.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['id'] = binaryReader:ReadInt32()
|
|
|
|
packet['level'] = binaryReader:ReadInt32()
|
|
|
|
packet['upgTime'] = binaryReader:ReadInt32()
|
|
|
|
packet['pdtTime'] = binaryReader:ReadInt32()
|
|
|
|
packet['pdtCount'] = binaryReader:ReadInt32()
|
|
|
|
|
|
return packet
|
|
end |