Plugin using xml/sqlite as storage
#1
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
Reply
Thanks given by:
#2
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
Reply
Thanks given by: nouseforname




Users browsing this thread: 1 Guest(s)