Add option to share decklists on load. (#6029)

* Add option to share decklists on load.

Took 1 hour 58 minutes

Took 9 minutes


Took 39 minutes

* Lint.

Took 14 minutes


Took 2 minutes

* Stuffs

Took 39 minutes

Took 4 seconds

Took 43 minutes

* Process local player first.

Took 45 minutes

* Consider if the setting is set on the game info first.

Took 4 minutes

* Save an indent level.

Took 43 seconds

* Don't commit logging config.

Took 3 minutes

* Remove a debug print.

Took 10 seconds


Took 7 seconds

* Add another optional guard.

Took 5 minutes

* Hide the tab bar if only one (own deck) is visible.

Took 9 minutes

* Rename setting label for clarity

Took 2 minutes

* Capitalization.

Took 3 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL
2025-08-15 23:31:05 +02:00
committed by GitHub
parent 881243da6a
commit 09381575a7
26 changed files with 268 additions and 33 deletions

View File

@@ -21,6 +21,7 @@
#include "decklist.h"
#include "pb/context_connection_state_changed.pb.h"
#include "pb/context_deck_select.pb.h"
#include "pb/context_ping_changed.pb.h"
#include "pb/event_delete_arrow.pb.h"
#include "pb/event_game_closed.pb.h"
@@ -62,15 +63,16 @@ Server_Game::Server_Game(const ServerInfo_User &_creatorInfo,
bool _spectatorsCanTalk,
bool _spectatorsSeeEverything,
int _startingLifeTotal,
bool _shareDecklistsOnLoad,
Server_Room *_room)
: QObject(), room(_room), nextPlayerId(0), hostId(0), creatorInfo(new ServerInfo_User(_creatorInfo)),
gameStarted(false), gameClosed(false), gameId(_gameId), password(_password), maxPlayers(_maxPlayers),
gameTypes(_gameTypes), activePlayer(-1), activePhase(-1), onlyBuddies(_onlyBuddies),
onlyRegistered(_onlyRegistered), spectatorsAllowed(_spectatorsAllowed),
spectatorsNeedPassword(_spectatorsNeedPassword), spectatorsCanTalk(_spectatorsCanTalk),
spectatorsSeeEverything(_spectatorsSeeEverything), startingLifeTotal(_startingLifeTotal), inactivityCounter(0),
startTimeOfThisGame(0), secondsElapsed(0), firstGameStarted(false), turnOrderReversed(false),
startTime(QDateTime::currentDateTime()), pingClock(nullptr),
spectatorsSeeEverything(_spectatorsSeeEverything), startingLifeTotal(_startingLifeTotal),
shareDecklistsOnLoad(_shareDecklistsOnLoad), inactivityCounter(0), startTimeOfThisGame(0), secondsElapsed(0),
firstGameStarted(false), turnOrderReversed(false), startTime(QDateTime::currentDateTime()), pingClock(nullptr),
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
gameMutex()
#else
@@ -800,6 +802,7 @@ void Server_Game::getInfo(ServerInfo_Game &result) const
result.set_spectators_need_password(getSpectatorsNeedPassword());
result.set_spectators_can_chat(spectatorsCanTalk);
result.set_spectators_omniscient(spectatorsSeeEverything);
result.set_share_decklists_on_load(shareDecklistsOnLoad);
result.set_spectators_count(getSpectatorCount());
result.set_start_time(startTime.toSecsSinceEpoch());
}