42 lines
996 B
Plaintext
42 lines
996 B
Plaintext
LuaDistributesMatGenl = {}
|
|
|
|
LuaDistributesMatGenl.sysID = 0
|
|
LuaDistributesMatGenl.cmdID = 0
|
|
|
|
function LuaDistributesMatGenl.ExtraPacket(memStream)
|
|
-- print('ExtraPacket:'..memStream.Length)
|
|
|
|
local binaryReader = CS.BinaryMessageHandle.GetLuaPacketReader(memStream)
|
|
local sysID = binaryReader:ReadByte()
|
|
local cmdID = binaryReader:ReadByte()
|
|
packet = LuaDistributesMatGenl.ReadPacket(binaryReader)
|
|
|
|
return packet
|
|
end
|
|
|
|
function LuaDistributesMatGenl.SendPacket(packet)
|
|
local message = CS.BinaryMessageHandle.CreateMessage(LuaDistributesMatGenl.sysID, LuaDistributesMatGenl.cmdID)
|
|
if(packet['pos'] == nil) then
|
|
packet['pos'] = 0
|
|
end
|
|
message:WriteByte(packet['pos'])
|
|
|
|
if(packet['generalGuid'] == nil) then
|
|
packet['generalGuid'] = 0
|
|
end
|
|
message:WriteLong(packet['generalGuid'])
|
|
|
|
|
|
message:Send()
|
|
end
|
|
|
|
function LuaDistributesMatGenl.ReadPacket(binaryReader)
|
|
|
|
local packet = {}
|
|
packet['pos'] = binaryReader:ReadByte()
|
|
|
|
packet['generalGuid'] = binaryReader:ReadInt64()
|
|
|
|
|
|
return packet
|
|
end |