From 13da9bb9c72b1e86c6b5e23d55228f79455ef630 Mon Sep 17 00:00:00 2001 From: Benau Date: Tue, 26 Nov 2019 12:01:11 +0800 Subject: [PATCH] Load database with full path for installed stk --- src/network/protocols/server_lobby.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network/protocols/server_lobby.cpp b/src/network/protocols/server_lobby.cpp index 98d68c543..8d87d5d37 100644 --- a/src/network/protocols/server_lobby.cpp +++ b/src/network/protocols/server_lobby.cpp @@ -223,7 +223,9 @@ void ServerLobby::initDatabase() m_ip_geolocation_table_exists = false; if (!ServerConfig::m_sql_management) return; - int ret = sqlite3_open_v2(ServerConfig::m_database_file.c_str(), &m_db, + const std::string& path = ServerConfig::getConfigDirectory() + "/" + + ServerConfig::m_database_file.c_str(); + int ret = sqlite3_open_v2(path.c_str(), &m_db, SQLITE_OPEN_SHAREDCACHE | SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_READWRITE, NULL); if (ret != SQLITE_OK)