diff options
| author | Machiavelli <none@none> | 2010-09-24 22:16:21 +0200 |
|---|---|---|
| committer | Machiavelli <none@none> | 2010-09-24 22:16:21 +0200 |
| commit | 3c6dc320308880bde4ef9eddd695db28a74aa0d9 (patch) | |
| tree | f209e6c487e436fc1cd978487dddf3604ce2b594 /src/server/worldserver | |
| parent | b46b498141cc167163c6112e8e2bfa32fec2d7dc (diff) | |
Core/DBLayer:
- Rewrite Field class to be able to store both binary prepared statement data and data from adhoc query resultsets
- Buffer the data of prepared statements using ResultSet and Field classes and let go of mysql c api structures after PreparedResultSet constructor. Fixes a race condition and thus a possible crash/data corruption (issue pointed out to Derex, basic suggestion by raczman)
- Conform PreparedResultSet and ResultSet to the same design standards, and using Field class as data buffer class for both
* NOTE: This means the fetching methods are uniform again, using ¨Field* fields = result->Fetch();¨ and access to elements trough fields[x].
* NOTE: for access to the correct row in prepared statements, ¨Field* fields = result->Fetch();¨ must ALWAYS be called inside the do { }while(result->NextRow()) loop.
* NOTE: This means that Field::GetString() returns std::string object and Field::GetCString() returns const char* pointer.
Still experimental and all that jazz, not recommended for production servers until feedback is given.
--HG--
branch : trunk
Diffstat (limited to 'src/server/worldserver')
| -rw-r--r-- | src/server/worldserver/CommandLine/CliRunnable.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 0a5b16563f5..226f22f647c 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -212,7 +212,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s DeletedInfo info; info.lowguid = fields[0].GetUInt32(); - info.name = fields[1].GetCppString(); + info.name = fields[1].GetString(); info.accountId = fields[2].GetUInt32(); // account name will be empty for not existed account @@ -562,7 +562,7 @@ bool ChatHandler::HandleAccountOnlineListCommand(const char* /*args*/) do { Field *fieldsDB = resultDB->Fetch(); - std::string name = fieldsDB[0].GetCppString(); + std::string name = fieldsDB[0].GetString(); uint32 account = fieldsDB[1].GetUInt32(); ///- Get the username, last IP and GM level of each account |
