Essentials [Warps, jails and so on]
#21
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.
Reply
Thanks given by:
#22
Toni already has that in Essentials :|
Reply
Thanks given by:
#23
(04-27-2015, 04:43 AM)tonibm19 Wrote: ... cause I have no idea about SQLite ...

That's why I created this interface of mine ^^ You use the Select function to get information, Insert to put information in, etc
Reply
Thanks given by:
#24
Anyway, I can fix the tabs and do a pull request tomorrow. Smile
Reply
Thanks given by:
#25
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 Smile
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? Smile
Reply
Thanks given by:
#26
None taken Wink

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.
Reply
Thanks given by:
#27
Thanks to mathias-gh tabs are done. So a big thanks to him.
Later I will add the comments and I think its ready.
Reply
Thanks given by:
#28
(04-28-2015, 12:58 AM)tonibm19 Wrote: Thanks to mathias-gh tabs are done. So a big thanks to him.
Later I will add the comments and I think its ready.
You're very welcome. Smile
I didn't change cheat.lua though, since I got a bit confused with the spaces at one part in the file.
Reply
Thanks given by:
#29
I guess it's done now. I fixed some minor issues there were (spamming console) and added some comments.
What do you think?
Reply
Thanks given by:
#30
effect command please! (would love to see effect source code xD)
Reply
Thanks given by:




Users browsing this thread: 10 Guest(s)