mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-29 04:12:24 +00:00
SetSharedPlatinum converted to QueryDatabase
This commit is contained in:
parent
cbce5e5eb6
commit
211b3a135e
@ -334,16 +334,13 @@ int32 SharedDatabase::GetSharedPlatinum(uint32 account_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
|
bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("UPDATE account SET sharedplat = sharedplat + %i WHERE id = %i", amount_to_add, account_id);
|
||||||
char *query = 0;
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success()) {
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE `account` SET `sharedplat` = `sharedplat` + %i WHERE id = %i", amount_to_add, account_id), errbuf)) {
|
std::cerr << "Error in SetSharedPlatinum query '" << query << "' " << results.ErrorMessage() << std::endl;
|
||||||
std::cerr << "Error in SetSharedPlatinum query '" << query << "' " << errbuf << std::endl;
|
|
||||||
safe_delete_array(query);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user