mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Move deck file writes into the database interface (#7834)
Deleting a deck, inserting an uploaded deck, and updating one in place were SQL statements in the socket handler, including the dynamic is_public clause and the follow-up visibility read. Add DeckFileData and DeckFileWriteResult to Server_DatabaseInterface with create/update/delete operations, implement them in Servatrice_DatabaseInterface with the same statements and bind order, and let cmdDeckUpload and cmdDeckDel ask the injected interface.
This commit is contained in:
parent
23781af1f0
commit
7734a94f83
4 changed files with 157 additions and 79 deletions
|
|
@ -129,6 +129,10 @@ public:
|
|||
DeckStorageResult setDeckFolderVisibility(int folderId, int userId, bool isPublic) override;
|
||||
DeckStorageResult createDeckFolder(int parentId, int userId, const QString &name) override;
|
||||
void deleteDeckFolder(int folderId) override;
|
||||
DeckFileWriteResult createDeckFile(int folderId, int userId, const DeckFileData &data) override;
|
||||
DeckFileWriteResult
|
||||
updateDeckFile(int deckId, int userId, const DeckFileData &data, bool updateVisibility) override;
|
||||
DeckStorageResult deleteDeckFile(int deckId, int userId) override;
|
||||
QMap<QString, ServerInfo_User> getBuddyList(const QString &name) override;
|
||||
QMap<QString, ServerInfo_User> getIgnoreList(const QString &name) override;
|
||||
bool isInBuddyList(const QString &whoseList, const QString &who) override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue