mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Add connection label to MySQL connects
This commit is contained in:
+3
-3
@@ -61,15 +61,15 @@ Database::Database(const char* host, const char* user, const char* passwd, const
|
||||
Connect(host, user, passwd, database, port);
|
||||
}
|
||||
|
||||
bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) {
|
||||
bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port, std::string connection_label) {
|
||||
uint32 errnum= 0;
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
if (!Open(host, user, passwd, database, port, &errnum, errbuf)) {
|
||||
LogError("Failed to connect to database: Error: {}", errbuf);
|
||||
LogError("[MySQL] Connection [{}] Failed to connect to database: Error [{}]", connection_label, errbuf);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
LogInfo("Using database [{}] at [{}]:[{}]", database, host,port);
|
||||
LogInfo("[MySQL] Connection [{}] database [{}] at [{}]:[{}]", connection_label, database, host,port);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ class Database : public DBcore {
|
||||
public:
|
||||
Database();
|
||||
Database(const char* host, const char* user, const char* passwd, const char* database,uint32 port);
|
||||
bool Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port);
|
||||
bool Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port, std::string connection_label = "default");
|
||||
~Database();
|
||||
|
||||
/* Character Creation */
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9153
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9154
|
||||
|
||||
#ifdef BOTS
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9027
|
||||
|
||||
Reference in New Issue
Block a user