summaryrefslogtreecommitdiff
path: root/src/dal
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-02-20 15:34:28 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-02-20 15:34:28 +0100
commitc70c6d19c1cabf46b595591802bceab63d371788 (patch)
tree1c153d2bfe560171bad5889d528dc5cf110e8533 /src/dal
parentd707495540581f8c1b9ab3d5007c9c4d1ab83b53 (diff)
parent587b7682e6bf7dd9e616c1d4789a5ed9aa986e6d (diff)
downloadmanaserv-c70c6d19c1cabf46b595591802bceab63d371788.tar.gz
manaserv-c70c6d19c1cabf46b595591802bceab63d371788.tar.bz2
manaserv-c70c6d19c1cabf46b595591802bceab63d371788.tar.xz
manaserv-c70c6d19c1cabf46b595591802bceab63d371788.zip
Merge branch 'master' into lpc2012
Conflicts: gameserver.cbp src/account-server/accounthandler.cpp src/game-server/attack.cpp src/game-server/attack.h src/game-server/being.cpp src/game-server/being.h src/game-server/character.cpp src/game-server/character.h src/game-server/inventory.cpp src/game-server/item.h src/game-server/monster.cpp src/game-server/monster.h
Diffstat (limited to 'src/dal')
-rw-r--r--src/dal/mysqldataprovider.cpp14
-rw-r--r--src/dal/mysqldataprovider.h2
-rw-r--r--src/dal/pqdataprovider.cpp8
-rw-r--r--src/dal/recordset.cpp16
-rw-r--r--src/dal/recordset.h10
5 files changed, 25 insertions, 25 deletions
diff --git a/src/dal/mysqldataprovider.cpp b/src/dal/mysqldataprovider.cpp
index 13036461..9f9c4a93 100644
--- a/src/dal/mysqldataprovider.cpp
+++ b/src/dal/mysqldataprovider.cpp
@@ -32,7 +32,7 @@ const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER ="mysql_username";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD ="mysql_password";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_HOST_DEF = "localhost";
-const unsigned int MySqlDataProvider::CFGPARAM_MYSQL_PORT_DEF = 3306;
+const unsigned MySqlDataProvider::CFGPARAM_MYSQL_PORT_DEF = 3306;
const std::string MySqlDataProvider::CFGPARAM_MYSQL_DB_DEF = "mana";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_USER_DEF = "mana";
const std::string MySqlDataProvider::CFGPARAM_MYSQL_PWD_DEF = "mana";
@@ -84,7 +84,7 @@ void MySqlDataProvider::connect()
= Configuration::getValue(CFGPARAM_MYSQL_USER, CFGPARAM_MYSQL_USER_DEF);
const std::string password
= Configuration::getValue(CFGPARAM_MYSQL_PWD, CFGPARAM_MYSQL_PWD_DEF);
- const unsigned int tcpPort
+ const unsigned tcpPort
= Configuration::getValue(CFGPARAM_MYSQL_PORT, CFGPARAM_MYSQL_PORT_DEF);
// allocate and initialize a new MySQL object suitable
@@ -158,10 +158,10 @@ const RecordSet &MySqlDataProvider::execSql(const std::string& sql,
throw DbSqlQueryExecFailure(mysql_error(mDb));
// set the field names.
- unsigned int nFields = mysql_num_fields(res);
+ unsigned nFields = mysql_num_fields(res);
MYSQL_FIELD* fields = mysql_fetch_fields(res);
Row fieldNames;
- for (unsigned int i = 0; i < nFields; ++i)
+ for (unsigned i = 0; i < nFields; ++i)
fieldNames.push_back(fields[i].name);
mRecordSet.setColumnHeaders(fieldNames);
@@ -172,7 +172,7 @@ const RecordSet &MySqlDataProvider::execSql(const std::string& sql,
{
Row r;
- for (unsigned int i = 0; i < nFields; ++i)
+ for (unsigned i = 0; i < nFields; ++i)
r.push_back(static_cast<char *>(row[i]));
mRecordSet.add(r);
@@ -411,13 +411,13 @@ const RecordSet &MySqlDataProvider::processSql()
res = mysql_stmt_result_metadata(mStmt);
// set the field names.
- unsigned int nFields = mysql_num_fields(res);
+ unsigned nFields = mysql_num_fields(res);
MYSQL_FIELD* fields = mysql_fetch_fields(res);
Row fieldNames;
resultBind = new MYSQL_BIND[mysql_num_fields(res)];
- unsigned int i = 0;
+ unsigned i = 0;
for (i = 0; i < mysql_num_fields(res); ++i)
{
resultBind[i].buffer_type = MYSQL_TYPE_STRING;
diff --git a/src/dal/mysqldataprovider.h b/src/dal/mysqldataprovider.h
index 945b284f..6f8de3a8 100644
--- a/src/dal/mysqldataprovider.h
+++ b/src/dal/mysqldataprovider.h
@@ -192,7 +192,7 @@ class MySqlDataProvider: public DataProvider
/** defines the default value of the CFGPARAM_MYSQL_HOST parameter */
static const std::string CFGPARAM_MYSQL_HOST_DEF;
/** defines the default value of the CFGPARAM_MYSQL_PORT parameter */
- static const unsigned int CFGPARAM_MYSQL_PORT_DEF;
+ static const unsigned CFGPARAM_MYSQL_PORT_DEF;
/** defines the default value of the CFGPARAM_MYSQL_DB parameter */
static const std::string CFGPARAM_MYSQL_DB_DEF;
/** defines the default value of the CFGPARAM_MYSQL_USER parameter */
diff --git a/src/dal/pqdataprovider.cpp b/src/dal/pqdataprovider.cpp
index 58959129..34dd5486 100644
--- a/src/dal/pqdataprovider.cpp
+++ b/src/dal/pqdataprovider.cpp
@@ -100,22 +100,22 @@ const RecordSet &PqDataProvider::execSql(const std::string& sql,
}
// get field count
- unsigned int nFields = PQnfields(res);
+ unsigned nFields = PQnfields(res);
// fill column names
Row fieldNames;
- for (unsigned int i = 0; i < nFields; i++)
+ for (unsigned i = 0; i < nFields; i++)
{
fieldNames.push_back(PQfname(res, i));
}
mRecordSet.setColumnHeaders(fieldNames);
// fill rows
- for (unsigned int r = 0; r < PQntuples(res); r++)
+ for (unsigned r = 0; r < PQntuples(res); r++)
{
Row row;
- for (unsigned int i = 0; i < nFields; i++)
+ for (unsigned i = 0; i < nFields; i++)
row.push_back(PQgetvalue(res, r, i));
mRecordSet.add(row);
diff --git a/src/dal/recordset.cpp b/src/dal/recordset.cpp
index 065bbd77..0529325f 100644
--- a/src/dal/recordset.cpp
+++ b/src/dal/recordset.cpp
@@ -61,7 +61,7 @@ bool RecordSet::isEmpty() const
*
* @return the number of rows.
*/
-unsigned int RecordSet::rows() const
+unsigned RecordSet::rows() const
{
return mRows.size();
}
@@ -71,7 +71,7 @@ unsigned int RecordSet::rows() const
*
* @return the number of columns.
*/
-unsigned int RecordSet::cols() const
+unsigned RecordSet::cols() const
{
return mHeaders.size();
}
@@ -93,7 +93,7 @@ void RecordSet::setColumnHeaders(const Row &headers)
*/
void RecordSet::add(const Row &row)
{
- const unsigned int nCols = mHeaders.size();
+ const unsigned nCols = mHeaders.size();
if (nCols == 0) {
throw RsColumnHeadersNotSet();
@@ -110,8 +110,8 @@ void RecordSet::add(const Row &row)
mRows.push_back(row);
}
-const std::string &RecordSet::operator()(const unsigned int row,
- const unsigned int col) const
+const std::string &RecordSet::operator()(const unsigned row,
+ const unsigned col) const
{
if ((row >= mRows.size()) || (col >= mHeaders.size())) {
std::ostringstream os;
@@ -125,7 +125,7 @@ const std::string &RecordSet::operator()(const unsigned int row,
return mRows[row][col];
}
-const std::string &RecordSet::operator()(const unsigned int row,
+const std::string &RecordSet::operator()(const unsigned row,
const std::string& name) const
{
if (row >= mRows.size()) {
@@ -147,8 +147,8 @@ const std::string &RecordSet::operator()(const unsigned int row,
}
// find the field index.
- const unsigned int nCols = mHeaders.size();
- unsigned int i;
+ const unsigned nCols = mHeaders.size();
+ unsigned i;
for (i = 0; i < nCols; ++i) {
if (mHeaders[i] == name) {
break;
diff --git a/src/dal/recordset.h b/src/dal/recordset.h
index 80c2e68f..91b434de 100644
--- a/src/dal/recordset.h
+++ b/src/dal/recordset.h
@@ -67,14 +67,14 @@ class RecordSet
*
* @return the number of rows.
*/
- unsigned int rows() const;
+ unsigned rows() const;
/**
* Get the number of columns.
*
* @return the number of columns.
*/
- unsigned int cols() const;
+ unsigned cols() const;
/**
* Set the column headers.
@@ -115,8 +115,8 @@ class RecordSet
* @exception std::invalid_argument if the recordset is empty.
*/
const std::string&
- operator()(const unsigned int row,
- const unsigned int col) const;
+ operator()(const unsigned row,
+ const unsigned col) const;
/**
@@ -134,7 +134,7 @@ class RecordSet
* the recordset is empty.
*/
const std::string&
- operator()(const unsigned int row,
+ operator()(const unsigned row,
const std::string &name) const;