mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Destroying database specifier
This commit is contained in:
@@ -26,9 +26,10 @@ void Database::Connect(const string& host, const string& database, const string&
|
||||
con->setClientOption("MYSQL_OPT_RECONNECT", &myTrue);
|
||||
} //Connect
|
||||
|
||||
void Database::Destroy() {
|
||||
void Database::Destroy(std::string source) {
|
||||
if (!con) return;
|
||||
Game::logger->Log("Database", "Destroying MySQL connection!\n");
|
||||
if (source != "") Game::logger->Log("Database", "Destroying MySQL connection from %s!\n", source.c_str());
|
||||
else Game::logger->Log("Database", "Destroying MySQL connection!\n");
|
||||
con->close();
|
||||
delete con;
|
||||
} //Destroy
|
||||
|
@@ -22,7 +22,7 @@ private:
|
||||
|
||||
public:
|
||||
static void Connect(const std::string& host, const std::string& database, const std::string& username, const std::string& password);
|
||||
static void Destroy();
|
||||
static void Destroy(std::string source="");
|
||||
static sql::Statement* CreateStmt();
|
||||
static sql::PreparedStatement* CreatePreppedStmt(const std::string& query);
|
||||
};
|
||||
|
Reference in New Issue
Block a user