mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 15:41:30 +00:00
SetAccountFlag converted to QueryDatabase
This commit is contained in:
parent
eb98563fa1
commit
2dbd616725
@ -7757,15 +7757,11 @@ void Client::LoadAccountFlags()
|
|||||||
|
|
||||||
void Client::SetAccountFlag(std::string flag, std::string val)
|
void Client::SetAccountFlag(std::string flag, std::string val)
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("REPLACE INTO account_flags (p_accid, p_flag, p_value) "
|
||||||
char *query = 0;
|
"VALUES( '%d', '%s', '%s')", account_id, flag.c_str(), val.c_str());
|
||||||
|
auto results = database.QueryDatabase(query);
|
||||||
MakeAnyLenString(&query, "REPLACE INTO account_flags (p_accid, p_flag, p_value) VALUES( '%d', '%s', '%s')", account_id, flag.c_str(), val.c_str());
|
if(!results.Success())
|
||||||
if(!database.RunQuery(query, strlen(query), errbuf))
|
std::cerr << "Error in SetAccountFlags query '" << query << "' " << results.ErrorMessage() << std::endl;
|
||||||
{
|
|
||||||
std::cerr << "Error in SetAccountFlags query '" << query << "' " << errbuf << std::endl;
|
|
||||||
}
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
accountflags[flag] = val;
|
accountflags[flag] = val;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user