diff --git a/src/servers/Server_Common/Database/Database.cpp b/src/servers/Server_Common/Database/Database.cpp index e9e45cb0..e1b57da7 100644 --- a/src/servers/Server_Common/Database/Database.cpp +++ b/src/servers/Server_Common/Database/Database.cpp @@ -161,7 +161,7 @@ boost::shared_ptr Database::query( const std::string& QueryString ) if( sendQuery(con, QueryString.c_str(), false) ) { - qResult = boost::shared_ptr( _StoreQueryResult( con ) ); + qResult = boost::shared_ptr( storeQueryResult( con ) ); } con->lock.unlock(); @@ -259,14 +259,14 @@ bool Database::handleError( DatabaseConnection *con, uint32_t ErrorNumber ) case 2055: // Lost connection to sql server - system error { // Let's instruct a reconnect to the db when we encounter these errors. - return _Reconnect( con ); + return reconnect( con ); }break; } return false; } -QueryResult * Database::_StoreQueryResult( DatabaseConnection * con ) +QueryResult * Database::storeQueryResult( DatabaseConnection * con ) { QueryResult *res; MYSQL_RES * pRes = mysql_store_result( con->conn ); @@ -289,7 +289,7 @@ QueryResult * Database::_StoreQueryResult( DatabaseConnection * con ) return res; } -bool Database::_Reconnect( DatabaseConnection * conn ) +bool Database::reconnect( DatabaseConnection * conn ) { MYSQL * temp; MYSQL * temp2; diff --git a/src/servers/Server_Common/Database/Database.h b/src/servers/Server_Common/Database/Database.h index c46a647c..6bfb0809 100644 --- a/src/servers/Server_Common/Database/Database.h +++ b/src/servers/Server_Common/Database/Database.h @@ -30,7 +30,7 @@ namespace Core { } // return as string - __inline std::string getString() + __inline std::string getString() const { if( !m_pValue ) return ""; @@ -38,7 +38,7 @@ namespace Core { } // return as string - __inline void getBinary( char* dstBuf, uint16_t size ) + __inline void getBinary( char* dstBuf, uint16_t size ) const { if( m_pValue ) { @@ -51,19 +51,19 @@ namespace Core { } // return as float - __inline float getFloat() + __inline float getFloat() const { return m_pValue ? static_cast< float >( atof( m_pValue ) ) : 0; } // return as bool - __inline bool getBool() + __inline bool getBool() const { return m_pValue ? atoi( m_pValue ) > 0 : false; } template< class T > - __inline T get() + __inline T get() const { if( !m_pValue ) return 0; @@ -71,7 +71,7 @@ namespace Core { return static_cast< T >( atol( m_pValue ) ); } - __inline uint32_t getLength() + __inline uint32_t getLength() const { return m_size; } @@ -175,9 +175,9 @@ namespace Core { // actual query function bool sendQuery( DatabaseConnection *con, const std::string &sql, bool Self ); - QueryResult * _StoreQueryResult( DatabaseConnection * con ); + QueryResult * storeQueryResult( DatabaseConnection * con ); bool handleError( DatabaseConnection *conn, uint32_t ErrorNumber ); - bool _Reconnect( DatabaseConnection *conn ); + bool reconnect( DatabaseConnection *conn ); DatabaseConnection *m_pConnections;