Thanks for the feedback! I'm actually not entirely sure which parts you're referring to as leftovers (probably skipping over things in my own code), but going through I can think of these
- line 17-20, - don't really need this, because the plugin doesn't register commands
- line 41-42, - too verbose/unnecessary?
- line 66-68, - empty callback, just remove? Should I keep the error callback?
- line 194-205, - perhaps this could be more accurately named . Is there a better way to get a subarray/splice of an array in lua? (googling lua subarray/splice/slice doesn't return much. There's an SO thread on implementing tail)
As for coding style, arguably extracting the session ID could be refactored higher up, but I kinda wanted to treat each packet type format as independent from each other as possible.
Also, I'm not sure of any vanilla lua ways of cleanly converting between bytes and ints, hence the awkwardness with and lines 94-97 (manually computing a 4 byte int from a byte array)
What did you have in mind?
I'm actually quite busy ATM with school coming to a close soon - finishing projects and catching up for exams, especially since I've had pretty bad work ethics xD But I will try my hand at #70 hopefully this weekend. Thanks for your time!
- line 17-20,
Code:
-- Use the InfoReg shared library to process the Info.lua file:
- line 41-42,
Code:
LOG("Not starting query server; disabled in settings.ini.")
- line 66-68,
Code:
OnReceivedData = function ()
- line 194-205,
Code:
function PacketReadInt(a_Data)
Code:
PacketRead4Bytes
As for coding style, arguably extracting the session ID could be refactored higher up, but I kinda wanted to treat each packet type format as independent from each other as possible.
Also, I'm not sure of any vanilla lua ways of cleanly converting between bytes and ints, hence the awkwardness with
Code:
PacketReadInt
What did you have in mind?
I'm actually quite busy ATM with school coming to a close soon - finishing projects and catching up for exams, especially since I've had pretty bad work ethics xD But I will try my hand at #70 hopefully this weekend. Thanks for your time!