1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-07 16:48:40 +00:00

Verify database connection on interval (#9665)

This commit is contained in:
Loïc Blot 2020-04-15 08:01:11 +02:00 committed by GitHub
parent 62c62f3829
commit 5c588f89e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 65 additions and 33 deletions

View file

@ -32,6 +32,7 @@ public:
virtual void beginSave() = 0;
virtual void endSave() = 0;
virtual bool initialized() const { return true; }
virtual void pingDatabase() {}
};
class MapDatabase : public Database
@ -57,6 +58,8 @@ class PlayerDatabase
public:
virtual ~PlayerDatabase() = default;
virtual void pingDatabase() {}
virtual void savePlayer(RemotePlayer *player) = 0;
virtual bool loadPlayer(RemotePlayer *player, PlayerSAO *sao) = 0;
virtual bool removePlayer(const std::string &name) = 0;
@ -83,4 +86,5 @@ public:
virtual bool deleteAuth(const std::string &name) = 0;
virtual void listNames(std::vector<std::string> &res) = 0;
virtual void reload() = 0;
virtual void pingDatabase() {}
};