mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
StoreCharacter partialy converted to StringFormat
This commit is contained in:
parent
80a8a1fde3
commit
fa3d8c9720
@ -566,7 +566,6 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
|
|||||||
{
|
{
|
||||||
char query[256+sizeof(PlayerProfile_Struct)*2+sizeof(ExtendedProfile_Struct)*2+5];
|
char query[256+sizeof(PlayerProfile_Struct)*2+sizeof(ExtendedProfile_Struct)*2+5];
|
||||||
char* end = query;
|
char* end = query;
|
||||||
char* invquery = nullptr;
|
|
||||||
uint32 charid = 0;
|
uint32 charid = 0;
|
||||||
char zone[50];
|
char zone[50];
|
||||||
float x, y, z;
|
float x, y, z;
|
||||||
@ -612,24 +611,22 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now the inventory
|
// now the inventory
|
||||||
|
std::string invquery;
|
||||||
for (int16 i=0; i<=2270;)
|
for (int16 i=0; i<=2270;)
|
||||||
{
|
{
|
||||||
const ItemInst* newinv = inv->GetItem(i);
|
const ItemInst* newinv = inv->GetItem(i);
|
||||||
if (!newinv)
|
if (!newinv)
|
||||||
{
|
{
|
||||||
auto results = QueryDatabase(invquery, MakeAnyLenString(&invquery,
|
invquery = StringFormat("INSERT INTO inventory SET charid=%0u, slotid=%0d, itemid=%0u, charges=%0d, color=%0u",
|
||||||
"INSERT INTO inventory SET "
|
charid, i, newinv->GetItem()->ID,newinv->GetCharges(), newinv->GetColor());
|
||||||
"charid=%0u, slotid=%0d, itemid=%0u, charges=%0d, color=%0u",
|
auto results = QueryDatabase(invquery);
|
||||||
charid, i, newinv->GetItem()->ID,
|
|
||||||
newinv->GetCharges(), newinv->GetColor()));
|
|
||||||
|
|
||||||
if (!results.RowsAffected())
|
if (!results.RowsAffected())
|
||||||
LogFile->write(EQEMuLog::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery, results.ErrorMessage().c_str());
|
LogFile->write(EQEMuLog::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str());
|
||||||
#if EQDEBUG >= 9
|
#if EQDEBUG >= 9
|
||||||
else
|
else
|
||||||
LogFile->write(EQEMuLog::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery);
|
LogFile->write(EQEMuLog::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str());
|
||||||
#endif
|
#endif
|
||||||
safe_delete_array(invquery);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i==30){ //end of standard inventory/cursor, jump to internals of bags/cursor
|
if(i==30){ //end of standard inventory/cursor, jump to internals of bags/cursor
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user