mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-18 19:41:30 +00:00
SetGMSpeed converted to QueryDatabase
This commit is contained in:
parent
edc2567b10
commit
bcf282da91
@ -77,18 +77,14 @@ uint8 SharedDatabase::GetGMSpeed(uint32 account_id)
|
|||||||
|
|
||||||
bool SharedDatabase::SetGMSpeed(uint32 account_id, uint8 gmspeed)
|
bool SharedDatabase::SetGMSpeed(uint32 account_id, uint8 gmspeed)
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("UPDATE account SET gmspeed = %i WHERE id = %i", gmspeed, account_id);
|
||||||
char *query = 0;
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success()) {
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE account SET gmspeed = %i where id = %i", gmspeed, account_id), errbuf)) {
|
std::cerr << "Error in SetGMSpeed query '" << query << "' " << results.ErrorMessage() << std::endl;
|
||||||
std::cerr << "Error in SetGMSpeed query '" << query << "' " << errbuf << std::endl;
|
|
||||||
safe_delete_array(query);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
|
uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user