mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
the stop dump zone command was implemented as a courtesy to other players in order to take into account when they would stop looking at unknown information however, this can be abused, a malicious client can send this command whenever they would like cockatrice is not a physical tabletop nor does it aim to be, if you can take a screenshot of your deck and then close the view, you are not cheating as you have been given this information in order to prevent anyone from abusing this we should remove the command from the protocol, this means servers will ignore this message and clients will get a little invalid command reply in their debug log the extension id will remain reserved shuffling your deck will always invalidate any card view looking at those cards if players wish to signal that they stopped looking at their deck for whatever reason they should just use the chat instead, optionally using one of the chat macros
111 lines
4.6 KiB
C++
111 lines
4.6 KiB
C++
#ifndef MESSAGELOGWIDGET_H
|
|
#define MESSAGELOGWIDGET_H
|
|
|
|
#include "chatview/chatview.h"
|
|
#include "translation.h"
|
|
#include "user_level.h"
|
|
|
|
class Player;
|
|
class CardZone;
|
|
class GameEventContext;
|
|
class CardItem;
|
|
|
|
class MessageLogWidget : public ChatView
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
enum MessageContext
|
|
{
|
|
MessageContext_None,
|
|
MessageContext_MoveCard,
|
|
MessageContext_Mulligan
|
|
};
|
|
|
|
int mulliganNumber;
|
|
Player *mulliganPlayer;
|
|
MessageContext currentContext;
|
|
QString messagePrefix, messageSuffix;
|
|
|
|
const QString &tableConstant() const;
|
|
const QString &graveyardConstant() const;
|
|
const QString &exileConstant() const;
|
|
const QString &handConstant() const;
|
|
const QString &deckConstant() const;
|
|
const QString &sideboardConstant() const;
|
|
const QString &stackConstant() const;
|
|
|
|
QString sanitizeHtml(QString dirty) const;
|
|
QString cardLink(QString cardName) const;
|
|
QPair<QString, QString> getFromStr(CardZone *zone, QString cardName, int position, bool ownerChange) const;
|
|
|
|
public slots:
|
|
void containerProcessingDone();
|
|
void containerProcessingStarted(const GameEventContext &context);
|
|
void logAlwaysRevealTopCard(Player *player, CardZone *zone, bool reveal);
|
|
void logAlwaysLookAtTopCard(Player *player, CardZone *zone, bool reveal);
|
|
void logAttachCard(Player *player, QString cardName, Player *targetPlayer, QString targetCardName);
|
|
void logConcede(Player *player);
|
|
void logUnconcede(Player *player);
|
|
void logConnectionStateChanged(Player *player, bool connectionState);
|
|
void logCreateArrow(Player *player,
|
|
Player *startPlayer,
|
|
QString startCard,
|
|
Player *targetPlayer,
|
|
QString targetCard,
|
|
bool playerTarget);
|
|
void logCreateToken(Player *player, QString cardName, QString pt);
|
|
void logDeckSelect(Player *player, QString deckHash, int sideboardSize);
|
|
void logDestroyCard(Player *player, QString cardName);
|
|
void logDrawCards(Player *player, int number);
|
|
void logDumpZone(Player *player, CardZone *zone, int numberCards);
|
|
void logFlipCard(Player *player, QString cardName, bool faceDown);
|
|
void logGameClosed();
|
|
void logGameStart();
|
|
void logJoin(Player *player);
|
|
void logJoinSpectator(QString name);
|
|
void logKicked();
|
|
void logLeave(Player *player, QString reason);
|
|
void logLeaveSpectator(QString name, QString reason);
|
|
void logNotReadyStart(Player *player);
|
|
void logMoveCard(Player *player, CardItem *card, CardZone *startZone, int oldX, CardZone *targetZone, int newX);
|
|
void logMulligan(Player *player, int number);
|
|
void logReplayStarted(int gameId);
|
|
void logReadyStart(Player *player);
|
|
void logRevealCards(Player *player,
|
|
CardZone *zone,
|
|
int cardId,
|
|
QString cardName,
|
|
Player *otherPlayer,
|
|
bool faceDown,
|
|
int amount);
|
|
void logReverseTurn(Player *player, bool reversed);
|
|
void logRollDie(Player *player, int sides, int roll);
|
|
void logSay(Player *player, QString message);
|
|
void logSetActivePhase(int phase);
|
|
void logSetActivePlayer(Player *player);
|
|
void logSetAnnotation(Player *player, CardItem *card, QString newAnnotation);
|
|
void logSetCardCounter(Player *player, QString cardName, int counterId, int value, int oldValue);
|
|
void logSetCounter(Player *player, QString counterName, int value, int oldValue);
|
|
void logSetDoesntUntap(Player *player, CardItem *card, bool doesntUntap);
|
|
void logSetPT(Player *player, CardItem *card, QString newPT);
|
|
void logSetSideboardLock(Player *player, bool locked);
|
|
void logSetTapped(Player *player, CardItem *card, bool tapped);
|
|
void logShuffle(Player *player, CardZone *zone, int start, int end);
|
|
void
|
|
logSpectatorSay(QString spectatorName, UserLevelFlags spectatorUserLevel, QString userPrivLevel, QString message);
|
|
void logUnattachCard(Player *player, QString cardName);
|
|
void logUndoDraw(Player *player, QString cardName);
|
|
void setContextJudgeName(QString player);
|
|
void appendHtmlServerMessage(const QString &html,
|
|
bool optionalIsBold = false,
|
|
QString optionalFontColor = QString()) override;
|
|
|
|
public:
|
|
void connectToPlayer(Player *player);
|
|
MessageLogWidget(const TabSupervisor *_tabSupervisor,
|
|
const UserlistProxy *_userlistProxy,
|
|
TabGame *_game,
|
|
QWidget *parent = nullptr);
|
|
};
|
|
|
|
#endif
|