mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-14 07:42:29 +00:00
SetAccountFlag converted to QueryDatabase
This commit is contained in:
parent
81a641c96c
commit
9c3f1937a7
@ -7737,17 +7737,16 @@ void Client::LoadAccountFlags()
|
|||||||
accountflags[row[0]] = row[1];
|
accountflags[row[0]] = row[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SetAccountFlag(std::string flag, std::string val)
|
void Client::SetAccountFlag(std::string flag, std::string val) {
|
||||||
{
|
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char *query = 0;
|
|
||||||
|
|
||||||
MakeAnyLenString(&query, "REPLACE INTO account_flags (p_accid, p_flag, p_value) VALUES( '%d', '%s', '%s')", account_id, flag.c_str(), val.c_str());
|
std::string query = StringFormat("REPLACE INTO account_flags (p_accid, p_flag, p_value) "
|
||||||
if(!database.RunQuery(query, strlen(query), errbuf))
|
"VALUES( '%d', '%s', '%s')",
|
||||||
{
|
account_id, flag.c_str(), val.c_str());
|
||||||
std::cerr << "Error in SetAccountFlags query '" << query << "' " << errbuf << std::endl;
|
auto results = database.QueryDatabase(query);
|
||||||
|
if(!results.Success()) {
|
||||||
|
std::cerr << "Error in SetAccountFlags query '" << query << "' " << results.ErrorMessage() << std::endl;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
accountflags[flag] = val;
|
accountflags[flag] = val;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user