Cuberite Forum
User settings API - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: User settings API (/thread-1580.html)



User settings API - jan64 - 09-14-2014

I'm proposing addition of simple database api to the core / mc-server (that'd be a better idea but, I most likely won't have time to do it):

GetUserSetting(username, settingname)
SetUserSetting(username, settingname, value)

And, possibly support for sqlite transactions

StartSettingsTransaction()
EndSettingsTransaction()

The table structure would be simple: UserName SettingName Value

It'd solve persistent storage of things like god-mode, money, or any other player-related value in a simple way.

Ps. Do we want /mail in Core?


RE: User settings API - Howaner - 09-14-2014

Please, no /mail command in the core plugin.
I hate this function.

What datatype should GetUserSetting return?
And data save with the player name is a very bad idea. We should save the uuid from the player


RE: User settings API - jan64 - 09-14-2014

Storing uuid's instead of names is a good idea, but the API user decides what to put there.
It'd be string (TEXT in the database) due to its relative versatility.