From c4ffc789cd203a31e99665f534ebf312c77302b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 20 Sep 2026 19:28:53 +0200 Subject: [PATCH] [DeckShare] Resolve the stable server client in the deck editor gate actShareDeck went through tabSupervisor->getClient(), which hands back a LocalClient while an offline game is running. LocalClient never sets its status, so a logged-in user could not share from the deck editor during a local game, and got a misleading "You must be connected" message. Expose the supervisor's stable remote client and use it for the gate and the dialog, matching the other share tabs. --- .../src/interface/widgets/tabs/abstract_tab_deck_editor.cpp | 5 +++-- cockatrice/src/interface/widgets/tabs/tab_supervisor.h | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp b/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp index c03ffb114..a6aa81b5a 100644 --- a/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp +++ b/cockatrice/src/interface/widgets/tabs/abstract_tab_deck_editor.cpp @@ -388,7 +388,8 @@ bool AbstractTabDeckEditor::actSaveDeckAs() */ void AbstractTabDeckEditor::actShareDeck() { - if (tabSupervisor->getClient()->getStatus() != StatusLoggedIn) { + AbstractClient *client = tabSupervisor->getServerClient(); + if (client->getStatus() != StatusLoggedIn) { QMessageBox::information(this, tr("Share deck"), tr("You must be connected to the server to share a deck.")); return; } @@ -399,7 +400,7 @@ void AbstractTabDeckEditor::actShareDeck() return; } - DlgShareDeck shareDialog(tabSupervisor->getClient(), deck, this); + DlgShareDeck shareDialog(client, deck, this); shareDialog.exec(); } diff --git a/cockatrice/src/interface/widgets/tabs/tab_supervisor.h b/cockatrice/src/interface/widgets/tabs/tab_supervisor.h index adde7f971..11f6ba630 100644 --- a/cockatrice/src/interface/widgets/tabs/tab_supervisor.h +++ b/cockatrice/src/interface/widgets/tabs/tab_supervisor.h @@ -152,6 +152,10 @@ public: return userInfo; } [[nodiscard]] AbstractClient *getClient() const; + [[nodiscard]] AbstractClient *getServerClient() const + { + return client; + } [[nodiscard]] UserListManager *getUserListManager() const { return userListManager;