mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Quest API] Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua (#3469)
* [Quest API] Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua # Perl - Add `$client->ClearAccountFlag(flag)`. - Add `$client->GetAccountFlags()`. # Lua - Add `client:ClearAccountFlag(flag)`. - Add `client:GetAccountFlags()`. # Notes - Made use of repositories and cleaned up existing code. * Update lua_client.cpp * Don't use auto.
This commit is contained in:
@@ -44,7 +44,35 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static void ClearFlag(
|
||||
Database& db,
|
||||
AccountFlagsRepository::AccountFlags e
|
||||
) {
|
||||
AccountFlagsRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"p_accid = {} AND p_flag = '{}'",
|
||||
e.p_accid,
|
||||
Strings::Escape(e.p_flag)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static void ReplaceFlag(
|
||||
Database& db,
|
||||
AccountFlagsRepository::AccountFlags e
|
||||
) {
|
||||
db.QueryDatabase(
|
||||
fmt::format(
|
||||
"REPLACE INTO {} ({}) VALUES ({}, '{}', '{}')",
|
||||
TableName(),
|
||||
ColumnsRaw(),
|
||||
e.p_accid,
|
||||
Strings::Escape(e.p_flag),
|
||||
Strings::Escape(e.p_value)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_ACCOUNT_FLAGS_REPOSITORY_H
|
||||
|
||||
Reference in New Issue
Block a user