mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-08 04:02:25 +00:00
Merge pull request #238 from addtheice/RunQueryToDatabaseQuery_zone_guild_mgr
AddItem converted to QueryDatabase
This commit is contained in:
commit
bcca35b7b7
@ -903,24 +903,16 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *Query="INSERT INTO `guild_bank` (`guildid`, `area`, `slot`, `itemid`, `qty`, `donator`, `permissions`, `WhoFor`) "
|
std::string query = StringFormat("INSERT INTO `guild_bank` "
|
||||||
"VALUES (%i, %i, %i, %i, %i, '%s', %i, '%s')";
|
"(`guildid`, `area`, `slot`, `itemid`, `qty`, `donator`, `permissions`, `WhoFor`) "
|
||||||
|
"VALUES (%i, %i, %i, %i, %i, '%s', %i, '%s')",
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor);
|
||||||
|
auto results = database.QueryDatabase(query);
|
||||||
char* query = 0;
|
if(!results.Success()) {
|
||||||
|
_log(GUILDS__BANK_ERROR, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str());
|
||||||
if(!database.RunQuery(query, MakeAnyLenString(&query, Query, GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor), errbuf))
|
|
||||||
{
|
|
||||||
_log(GUILDS__BANK_ERROR, "Insert Error: %s : %s", query, errbuf);
|
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
const Item_Struct *Item = database.GetItem(ItemID);
|
const Item_Struct *Item = database.GetItem(ItemID);
|
||||||
|
|
||||||
GuildBankItemUpdate_Struct gbius;
|
GuildBankItemUpdate_Struct gbius;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user