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
This commit is contained in:
Machiavelli
2010-09-24 22:16:21 +02:00
parent b46b498141
commit 3c6dc32030
47 changed files with 1003 additions and 875 deletions
+8 -8
View File
@@ -58,16 +58,16 @@ Quest::Quest(Field * questRecord)
SrcItemId = questRecord[31].GetUInt32();
SrcItemCount = questRecord[32].GetUInt32();
SrcSpell = questRecord[33].GetUInt32();
Title = questRecord[34].GetCppString();
Details = questRecord[35].GetCppString();
Objectives = questRecord[36].GetCppString();
OfferRewardText = questRecord[37].GetCppString();
RequestItemsText = questRecord[38].GetCppString();
EndText = questRecord[39].GetCppString();
CompletedText = questRecord[40].GetCppString();
Title = questRecord[34].GetString();
Details = questRecord[35].GetString();
Objectives = questRecord[36].GetString();
OfferRewardText = questRecord[37].GetString();
RequestItemsText = questRecord[38].GetString();
EndText = questRecord[39].GetString();
CompletedText = questRecord[40].GetString();
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
ObjectiveText[i] = questRecord[41+i].GetCppString();
ObjectiveText[i] = questRecord[41+i].GetString();
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
ReqItemId[i] = questRecord[45+i].GetUInt32();