mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Serve card-art rules and params through the database interface (#7850)
The four card-art commands still prepared their statements inline through Servatrice_DatabaseInterface: the two card_art_params updates in cmdSetCardArtParams, the rule upsert and delete, and the rule listing that mapped rows to protocol entries. Add CardArtRuleRecord, upsertCardArtRule, removeCardArtRule, getCardArtRules, setCardArtParams and clearCardArtParams to Server_DatabaseInterface with fail-closed defaults, implement them with the previous statements, and keep the validation, clamping, in-memory userInfo sync and broadcast in the handler.
This commit is contained in:
parent
2608228bdd
commit
1822d16a72
4 changed files with 140 additions and 38 deletions
|
|
@ -875,6 +875,38 @@ public:
|
|||
{
|
||||
return false;
|
||||
}
|
||||
/** @brief One card-art name rule. */
|
||||
struct CardArtRuleRecord
|
||||
{
|
||||
QString cardName;
|
||||
QString cardProviderId;
|
||||
QString mode;
|
||||
QString reason;
|
||||
};
|
||||
virtual bool upsertCardArtRule(const QString & /* cardName */,
|
||||
const QString & /* cardProviderId */,
|
||||
const QString & /* mode */,
|
||||
const QString & /* reason */,
|
||||
int /* createdBy */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool removeCardArtRule(const QString & /* cardName */, const QString & /* cardProviderId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool getCardArtRules(QList<CardArtRuleRecord> & /* rules */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool setCardArtParams(int /* userId */, const QString & /* paramsJson */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool clearCardArtParams(int /* userId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* @brief Whether the given card art may be shown (card art rules).
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue