1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Show supported backends in --help output (#16441)

This commit is contained in:
sfan5 2025-08-25 21:36:25 +02:00 committed by GitHub
parent 04d9bd518f
commit 3f0f7f4285
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 113 additions and 17 deletions

View file

@ -1828,6 +1828,21 @@ void ServerEnvironment::processActiveObjectRemove(ServerActiveObject *obj)
m_script->removeObjectReference(obj);
}
std::vector<std::string> ServerEnvironment::getPlayerDatabaseBackends()
{
std::vector<std::string> ret;
ret.emplace_back("sqlite3");
ret.emplace_back("dummy");
#if USE_POSTGRESQL
ret.emplace_back("postgresql");
#endif
#if USE_LEVELDB
ret.emplace_back("leveldb");
#endif
ret.emplace_back("files");
return ret;
}
PlayerDatabase *ServerEnvironment::openPlayerDatabase(const std::string &name,
const std::string &savedir, const Settings &conf)
{
@ -1944,6 +1959,21 @@ bool ServerEnvironment::migratePlayersDatabase(const GameParams &game_params,
return true;
}
std::vector<std::string> ServerEnvironment::getAuthDatabaseBackends()
{
std::vector<std::string> ret;
ret.emplace_back("sqlite3");
ret.emplace_back("dummy");
#if USE_POSTGRESQL
ret.emplace_back("postgresql");
#endif
ret.emplace_back("files");
#if USE_LEVELDB
ret.emplace_back("leveldb");
#endif
return ret;
}
AuthDatabase *ServerEnvironment::openAuthDatabase(
const std::string &name, const std::string &savedir, const Settings &conf)
{