mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 17:43:52 +00:00
AddBuyLine converted to QueryDatabase
This commit is contained in:
parent
e19a59b269
commit
9ed69999a5
@ -754,13 +754,12 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) {
|
||||
|
||||
void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, const char* ItemName, uint32 Quantity, uint32 Price) {
|
||||
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char* query = 0;
|
||||
if (!(RunQuery(query,MakeAnyLenString(&query, "replace INTO buyer VALUES(%i,%i, %i,\"%s\",%i,%i)",
|
||||
CharID, BuySlot, ItemID, ItemName, Quantity, Price),errbuf)))
|
||||
_log(TRADING__CLIENT, "Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, errbuf);
|
||||
std::string query = StringFormat("REPLACE INTO buyer VALUES(%i, %i, %i, \"%s\", %i, %i)",
|
||||
CharID, BuySlot, ItemID, ItemName, Quantity, Price);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
_log(TRADING__CLIENT, "Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str());
|
||||
|
||||
safe_delete_array(query);
|
||||
}
|
||||
|
||||
void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user