mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Verify database connection on interval (#9665)
This commit is contained in:
@@ -36,13 +36,13 @@ public:
|
||||
void beginSave();
|
||||
void endSave();
|
||||
|
||||
// Open and initialize the database if needed
|
||||
virtual void pingDatabase();
|
||||
|
||||
bool initialized() const { return m_initialized; }
|
||||
protected:
|
||||
Database_SQLite3(const std::string &savedir, const std::string &dbname);
|
||||
|
||||
// Open and initialize the database if needed
|
||||
void verifyDatabase();
|
||||
|
||||
// Convertors
|
||||
inline void str_to_sqlite(sqlite3_stmt *s, int iCol, const std::string &str) const
|
||||
{
|
||||
@@ -146,6 +146,8 @@ public:
|
||||
MapDatabaseSQLite3(const std::string &savedir);
|
||||
virtual ~MapDatabaseSQLite3();
|
||||
|
||||
virtual void pingDatabase() { Database_SQLite3::pingDatabase(); }
|
||||
|
||||
bool saveBlock(const v3s16 &pos, const std::string &data);
|
||||
void loadBlock(const v3s16 &pos, std::string *block);
|
||||
bool deleteBlock(const v3s16 &pos);
|
||||
@@ -173,6 +175,8 @@ public:
|
||||
PlayerDatabaseSQLite3(const std::string &savedir);
|
||||
virtual ~PlayerDatabaseSQLite3();
|
||||
|
||||
virtual void pingDatabase() { Database_SQLite3::pingDatabase(); }
|
||||
|
||||
void savePlayer(RemotePlayer *player);
|
||||
bool loadPlayer(RemotePlayer *player, PlayerSAO *sao);
|
||||
bool removePlayer(const std::string &name);
|
||||
@@ -208,6 +212,8 @@ public:
|
||||
AuthDatabaseSQLite3(const std::string &savedir);
|
||||
virtual ~AuthDatabaseSQLite3();
|
||||
|
||||
virtual void pingDatabase() { Database_SQLite3::pingDatabase(); }
|
||||
|
||||
virtual bool getAuth(const std::string &name, AuthEntry &res);
|
||||
virtual bool saveAuth(const AuthEntry &authEntry);
|
||||
virtual bool createAuth(AuthEntry &authEntry);
|
||||
|
Reference in New Issue
Block a user