04-27-2015, 05:25 AM
Would probably be a good idea to split the code of each command into a different .lua file, like Core does, to make it more clear.
Essentials [Warps, jails and so on]
|
04-27-2015, 05:25 AM
Would probably be a good idea to split the code of each command into a different .lua file, like Core does, to make it more clear.
04-27-2015, 05:31 AM
Toni already has that in Essentials :|
04-27-2015, 05:34 AM
04-27-2015, 05:39 AM
Anyway, I can fix the tabs and do a pull request tomorrow.
04-27-2015, 06:28 AM
No offense, STR, but your SQLite wrappers really are too lengthy to use. A glorified wrapper over string. Compare:
local whereList = cWhereList():Where('uuid', a_UUID) local updateList = cUpdateList():Update("password", cCryptoHash.md5HexString(a_Password)) local res = self.m_DB:Update("players", updateList, whereList)vs local res = self.m_DB:ExecuteStatement( "UPDATE players SET password = ? WHERE uuid=?", { cCryptoHash.md5HexString(a_Password), a_UUID } ) Your approach reminds me of C++ streams, while mine is more printf-like One more example to consider: self.m_DB:ExecuteStatement([[ SELECT Areas.MinX AS MinX, Areas.MinZ AS MinZ, Areas.MaxX AS MaxX, Areas.MaxZ as MaxZ, Areas.StartX AS StartX, Areas.StartZ AS StartZ, Areas.EndX AS EndX, Areas.EndZ AS EndZ, Areas.PlayerName AS PlayerName, Areas.Name AS Name, Areas.ID AS ID, Areas.GalleryIndex AS GalleryIndex, Areas.GalleryName AS GalleryName, Areas.IsLocked AS IsLocked, Areas.LockedBy AS LockedBy, Areas.DateLocked as DateLocked FROM Areas INNER JOIN Allowances ON Areas.ID = Allowances.AreaID WHERE Areas.WorldName = ? AND Allowances.FriendName = ? ]], ...)(Where is your god now?
04-27-2015, 06:36 AM
None taken
I find my code to be really easy to read and to re-use. The XYZLists can be used on other places as well. True, you can't use every feature SQL has to offer like INNER JOIN, but if needed you can use the Query function to execute an SQL statement directly.
04-28-2015, 12:58 AM
Thanks to mathias-gh tabs are done. So a big thanks to him.
Later I will add the comments and I think its ready.
04-28-2015, 01:12 AM
04-28-2015, 04:15 AM
I guess it's done now. I fixed some minor issues there were (spamming console) and added some comments.
What do you think?
04-28-2015, 07:31 AM
effect command please! (would love to see effect source code xD)
|
« Next Oldest | Next Newest »
|