mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Move deck-path and visibility lookups into the database interface (#7832)
Resolving a deck folder path, reading a deck's owner, and walking its folder chain for public visibility were SQL queries living in the socket handler, keyed to the logged-in user through userInfo. Declare the three lookups on Server_DatabaseInterface, implement them in Servatrice_DatabaseInterface with the user id as an explicit parameter, and let the deck commands ask the injected interface.
This commit is contained in:
parent
28f92ac5f5
commit
8c0e796b0d
5 changed files with 106 additions and 93 deletions
|
|
@ -180,6 +180,21 @@ public:
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
/** @brief Id of the folder at a "/"-separated path for one user, 0 for the root, -1 when absent. */
|
||||
virtual int getDeckPathId(const QString & /* path */, int /* userId */)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/** @brief Owner of a deck file, or -1 when the deck does not exist. */
|
||||
virtual int getDeckOwnerId(int /* deckId */)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/** @brief Whether a deck is public itself or sits in a public folder. */
|
||||
virtual bool isDeckEffectivelyPublic(int /* deckId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool removeForgotPassword(const QString & /* user */)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue