Query Plugin
#3
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,
Code:
-- Use the InfoReg shared library to process the Info.lua file:
- don't really need this, because the plugin doesn't register commands
- line 41-42,
Code:
LOG("Not starting query server; disabled in settings.ini.")
- too verbose/unnecessary?
- line 66-68,
Code:
OnReceivedData = function ()
- empty callback, just remove? Should I keep the error callback?
- line 194-205,
Code:
function PacketReadInt(a_Data)
- perhaps this could be more accurately named
Code:
PacketRead4Bytes
. 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
Code:
PacketReadInt
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!
Reply
Thanks given by:


Messages In This Thread
Query Plugin - by Raekye - 03-24-2015, 04:40 AM
RE: Query Plugin - by xoft - 03-24-2015, 08:37 AM
RE: Query Plugin - by Raekye - 03-25-2015, 03:06 PM



Users browsing this thread: 1 Guest(s)