aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Pet
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-09-24 22:16:21 +0200
committerMachiavelli <none@none>2010-09-24 22:16:21 +0200
commit3c6dc320308880bde4ef9eddd695db28a74aa0d9 (patch)
treef209e6c487e436fc1cd978487dddf3604ce2b594 /src/server/game/Entities/Pet
parentb46b498141cc167163c6112e8e2bfa32fec2d7dc (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/game/Entities/Pet')
-rw-r--r--src/server/game/Entities/Pet/Pet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp
index 277e7e04956..a85147ce4c5 100644
--- a/src/server/game/Entities/Pet/Pet.cpp
+++ b/src/server/game/Entities/Pet/Pet.cpp
@@ -299,7 +299,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
// load action bar, if data broken will fill later by default spells.
if (!is_temporary_summoned)
{
- m_charmInfo->LoadPetActionBar(fields[13].GetCppString());
+ m_charmInfo->LoadPetActionBar(fields[13].GetString());
_LoadSpells();
InitTalentForLevel(); // re-init to check talent count
@@ -331,7 +331,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
Field *fields2 = result->Fetch();
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{
- m_declinedname->name[i] = fields2[i].GetCppString();
+ m_declinedname->name[i] = fields2[i].GetString();
}
}
}