Plugin using xml/sqlite as storage - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: Plugin using xml/sqlite as storage (/thread-1654.html) |
Plugin using xml/sqlite as storage - nouseforname - 11-18-2014 Hi all, i am brand new to this stuff here. Just set up a simple server to check out all the functions. Now trying to understand plugins and actually try to modify/create one to my needs. It seems not to difficult actually, but what i didnt find yet is... how can i use data storage? My prefered style would be xml and/or sqlite, depending on data type. But i didnt find anything about this yet. Can anyone give me a short hint how to create/query xml/sqlite storages? thanks in advance nouse RE: Plugin using xml/sqlite as storage - xoft - 11-18-2014 Hello, welcome to the forum. We have Lua bindings for the LuaExpat library, it's in the "lxp" table. Some initial documentation is in the LuaAPI docs: http://mc-server.xoft.cz/LuaAPI/lxp.html . Further docs are at the LuaExpat webpage: http://matthewwild.co.uk/projects/luaexpat/index.html Unfortunately there is no XML writer yet, so this path is more for the configuration than actual data storage. We have access to SQLite bindings via the LuaSQLite library, somewhat documented in the docs: http://mc-server.xoft.cz/LuaAPI/sqlite3.html . Further docs are again at the LuaSQLite webpage: http://lua.sqlite.org/index.cgi/index The SQLite libraries have been used extensively in some plugins, so there are actually a few examples available: - Gallery: https://github.com/mc-server/Gallery - Core (banlist): https://github.com/mc-server/Core - ProtectionAreas: https://github.com/mc-server/ProtectionAreas - PrivateBlocks: https://github.com/madmaxoft/PrivateBlocks |