glua net monitor
1.0.0
ยูทิลิตี้ง่ายๆ ที่รวบรวมข้อความเน็ตขาออกและขาเข้าเพื่อช่วยคุณแก้ไขข้อบกพร่องและเพิ่มประสิทธิภาพแบนด์วิดท์ รองรับทั้งเน็ตไลบรารีและไลบรารี umsg ที่เลิกใช้แล้ว (โปรดอัปเดตส่วนเสริมของคุณหากคุณยังใช้งานอยู่)
เพียงวางโฟลเดอร์ gLua-net-monitor
ลงในโฟลเดอร์ garrysmod/addons
ของคุณ มันก็จะทำงานได้ด้วยตัวเอง
ส่วนเสริมที่แทนที่การแทนที่ฟังก์ชัน net/umsg/bf_read ใด ๆ จะต้องเรียกใช้การใช้งานพื้นฐานเพื่อให้สิ่งนี้ทำงานได้ การเอาชนะ net.Incoming
อาจทำให้ยูทิลิตีนี้ไม่สามารถจับข้อความขาเข้าได้เนื่องจากต้องใช้ส่วนหัวของข้อความในการทำงาน
ตามค่าเริ่มต้น ไฟล์ hooks.lua
มีการใช้งานพื้นฐานบางอย่างสำหรับการดีบัก รู้สึกอิสระที่จะกำจัดพวกเขา
-- Called when a net message is started.
-- @ param msgName: name of the message that was started.
-- @ param funcInfo: info about the function that started the message.
hook . Add ( " OnNetMessageStarted " , " NetStarted " , function ( msgName , funcInfo ) end )
-- Called when a net message is captured, for both outgoing and incoming messages.
-- Keep your code fast in here! This is called for every net/umsg message.
-- @ param msg: The captured message, see NetMonitor.CapturedMessage
-- @ param funcInfo: For outgoing messages, the function who started the message.
hook . Add ( " OnNetMessageCaptured " , " NetCaptured " , function ( msg , funcInfo ) end )
-- Called when a net message is received but no receiving function is hooked.
-- This is likely an oversight of a developer, albeit a wasteful one.
-- @ param msg: The captured message, see NetMonitor.CapturedMessage
hook . Add ( " OnNetMessageIgnored " , " NetIgnored " , function ( msg ) end )
-- Called when a received net message does not read all the received data.
-- Not called for the usermessage lib messages.
-- Called after OnNetMessageCaptured & OnNetMessageIgnored
-- This means you or an addon on your server is wasting bandwidth!
-- @ param msg: The captured message, see NetMonitor.CapturedMessage
-- @note: The captured message data will contain a binary string dump of the remaining data.
hook . Add ( " OnNetMessageDumpedData " , " NetDumped " , function ( msg ) end )
-- Called when a net message is discarded due to starting another without finishing the current one.
-- @ param msg: The captured message which got discarded, likely missing some information.
-- @ param funcInfo: The info about the function which called the dicarded message's net.Start()
hook . Add ( " OnNetMessageDiscarded " , " NetDiscarded " , function ( msg , funcInfo ) end )
-- Called clientside when the server's registry is received.
hook . Add ( " OnNetRegistryUpdated " , " NetRegistryUpdate " , function () end )