aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnubisss <none@none>2010-09-30 20:32:09 +0200
committerAnubisss <none@none>2010-09-30 20:32:09 +0200
commit84a29b2d351c07868ec150efcf15263f373fe9d7 (patch)
tree1aae3c638fb92fa72690ea78c0f1945588ca76f4 /src
parent41d816740bd4eb567083c825ac613301c04a89c2 (diff)
Remove const from MySQLConnectionInfo, can't use non const functions in a const struct. This fixes the compile error.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.h4
-rw-r--r--src/server/shared/Database/Implementation/LoginDatabase.h4
-rw-r--r--src/server/shared/Database/Implementation/WorldDatabase.h4
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp6
-rw-r--r--src/server/shared/Database/MySQLConnection.h11
5 files changed, 12 insertions, 17 deletions
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h
index b2f26fc7f05..d30b47e757a 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h
@@ -26,8 +26,8 @@ class CharacterDatabaseConnection : public MySQLConnection
{
public:
//- Constructors for sync and async connections
- CharacterDatabaseConnection(const MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) {}
- CharacterDatabaseConnection(ACE_Activation_Queue* q, const MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) {}
+ CharacterDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) {}
+ CharacterDatabaseConnection(ACE_Activation_Queue* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) {}
//- Loads databasetype specific prepared statements
bool Open();
diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h
index 6daa53baebe..b5147256c52 100644
--- a/src/server/shared/Database/Implementation/LoginDatabase.h
+++ b/src/server/shared/Database/Implementation/LoginDatabase.h
@@ -26,8 +26,8 @@ class LoginDatabaseConnection : public MySQLConnection
{
public:
//- Constructors for sync and async connections
- LoginDatabaseConnection(const MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) {}
- LoginDatabaseConnection(ACE_Activation_Queue* q, const MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) {}
+ LoginDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) {}
+ LoginDatabaseConnection(ACE_Activation_Queue* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) {}
//- Loads databasetype specific prepared statements
bool Open();
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h
index 981ff906fc4..9470b2bb03f 100644
--- a/src/server/shared/Database/Implementation/WorldDatabase.h
+++ b/src/server/shared/Database/Implementation/WorldDatabase.h
@@ -26,8 +26,8 @@ class WorldDatabaseConnection : public MySQLConnection
{
public:
//- Constructors for sync and async connections
- WorldDatabaseConnection(const MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) {}
- WorldDatabaseConnection(ACE_Activation_Queue* q, const MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) {}
+ WorldDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) {}
+ WorldDatabaseConnection(ACE_Activation_Queue* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) {}
//- Loads databasetype specific prepared statements
bool Open();
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index cac23e1fd88..c16e42b71d6 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -32,7 +32,7 @@
#include "DatabaseWorker.h"
#include "Timer.h"
-MySQLConnection::MySQLConnection(const MySQLConnectionInfo& connInfo) :
+MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) :
m_connectionInfo(connInfo),
m_queue(NULL),
m_worker(NULL),
@@ -40,7 +40,7 @@ m_Mysql(NULL)
{
}
-MySQLConnection::MySQLConnection(ACE_Activation_Queue* queue, const MySQLConnectionInfo& connInfo) :
+MySQLConnection::MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInfo& connInfo) :
m_connectionInfo(connInfo),
m_queue(queue),
m_Mysql(NULL)
@@ -98,7 +98,7 @@ bool MySQLConnection::Open()
{
unsigned int opt = MYSQL_PROTOCOL_SOCKET;
mysql_options(mysqlInit, MYSQL_OPT_PROTOCOL, (char const*)&opt);
- m_connectionInfo.ChangeHost("localhost");
+ m_connectionInfo.host = "localhost";
port = 0;
unix_socket = m_connectionInfo.port_or_socket.c_str();
}
diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h
index 34287948aed..6dc22efd130 100644
--- a/src/server/shared/Database/MySQLConnection.h
+++ b/src/server/shared/Database/MySQLConnection.h
@@ -53,11 +53,6 @@ struct MySQLConnectionInfo
std::string database;
std::string host;
std::string port_or_socket;
-
- void ChangeHost(const std::string& newHost) /// Needed for unix socket case
- {
- host = newHost;
- }
};
class MySQLConnection
@@ -66,8 +61,8 @@ class MySQLConnection
friend class PingOperation;
public:
- MySQLConnection(const MySQLConnectionInfo& connInfo); //! Constructor for synchroneous connections.
- MySQLConnection(ACE_Activation_Queue* queue, const MySQLConnectionInfo& connInfo); //! Constructor for asynchroneous connections.
+ MySQLConnection(MySQLConnectionInfo& connInfo); //! Constructor for synchroneous connections.
+ MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInfo& connInfo); //! Constructor for asynchroneous connections.
~MySQLConnection();
virtual bool Open();
@@ -111,7 +106,7 @@ class MySQLConnection
ACE_Activation_Queue* m_queue; //! Queue shared with other asynchroneous connections.
DatabaseWorker* m_worker; //! Core worker task.
MYSQL * m_Mysql; //! MySQL Handle.
- const MySQLConnectionInfo& m_connectionInfo; //! Connection info (used for logging)
+ MySQLConnectionInfo& m_connectionInfo; //! Connection info (used for logging)
ACE_Thread_Mutex m_Mutex;
};