Cuberite Forum
Essentials [Warps, jails and so on] - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Releases (https://forum.cuberite.org/forum-2.html)
+--- Thread: Essentials [Warps, jails and so on] (/thread-1840.html)

Pages: 1 2 3 4 5 6 7


RE: Essentials BETA [Warps, Jails and so on] - Mathias - 04-27-2015

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.


RE: Essentials BETA [Warps, Jails and so on] - NiLSPACE - 04-27-2015

Toni already has that in Essentials :|


RE: Essentials BETA [Warps, Jails and so on] - NiLSPACE - 04-27-2015

(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


RE: Essentials BETA [Warps, Jails and so on] - Mathias - 04-27-2015

Anyway, I can fix the tabs and do a pull request tomorrow. Smile


RE: Essentials BETA [Warps, Jails and so on] - xoft - 04-27-2015

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


RE: Essentials BETA [Warps, Jails and so on] - NiLSPACE - 04-27-2015

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.


RE: Essentials BETA [Warps, Jails and so on] - tonibm19 - 04-28-2015

Thanks to mathias-gh tabs are done. So a big thanks to him.
Later I will add the comments and I think its ready.


RE: Essentials BETA [Warps, Jails and so on] - Mathias - 04-28-2015

(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.


RE: Essentials BETA [Warps, Jails and so on] - tonibm19 - 04-28-2015

I guess it's done now. I fixed some minor issues there were (spamming console) and added some comments.
What do you think?


RE: Essentials BETA [Warps, Jails and so on] - Sources - 04-28-2015

effect command please! (would love to see effect source code xD)