From 3b048ee8a2fa35315833fa09245a82989e0aaa8c Mon Sep 17 00:00:00 2001 From: akkadius Date: Sun, 24 Aug 2014 07:13:15 -0500 Subject: [PATCH] Character creation process crash fix (world) and query cleanup --- changelog.txt | 3 +++ common/database.cpp | 7 ++++--- zone/queryserv.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 3836b437e..7b485913e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 08/24/2014 == +Akkadius: Character creation process crash fix and query cleanup + == 08/23/2014 == Akkadius: Changed zone process window title format, example: 'crushbone :: clients: 6 inst_id: 1 inst_ver: 0 :: port: 7015' Akkadius: Most of the following changes are QueryServ related, fully implemented its original functionality to be able to offload diff --git a/common/database.cpp b/common/database.cpp index e82f350b1..8d27d5b46 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -608,10 +608,11 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven for (int16 i=EmuConstants::EQUIPMENT_BEGIN; i<=EmuConstants::BANK_BAGS_END;) { const ItemInst* newinv = inv->GetItem(i); - if (!newinv) + if (newinv) { - invquery = StringFormat("INSERT INTO inventory SET charid=%0u, slotid=%0d, itemid=%0u, charges=%0d, color=%0u", - charid, i, newinv->GetItem()->ID,newinv->GetCharges(), newinv->GetColor()); + invquery = StringFormat("INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)", + charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor()); + auto results = QueryDatabase(invquery); if (!results.RowsAffected()) diff --git a/zone/queryserv.h b/zone/queryserv.h index e0c7d4e56..8aafcafda 100644 --- a/zone/queryserv.h +++ b/zone/queryserv.h @@ -21,7 +21,7 @@ enum PlayerGenericLogEventTypes { Player_Log_Issued_Commands, Player_Log_Money_Transactions, Player_Log_Alternate_Currency_Transactions, -}; +}; class QueryServ{