diff --git a/client/CServerHandler.h b/client/CServerHandler.h index 1ef583e0c..a62aa8a45 100644 --- a/client/CServerHandler.h +++ b/client/CServerHandler.h @@ -25,7 +25,6 @@ struct TurnTimerInfo; class CMapInfo; class CGameState; struct ClientPlayer; -struct CPack; struct CPackForLobby; struct CPackForClient; diff --git a/client/Client.h b/client/Client.h index 7f14f2b82..b9e855ca5 100644 --- a/client/Client.h +++ b/client/Client.h @@ -16,7 +16,6 @@ VCMI_LIB_NAMESPACE_BEGIN -struct CPack; struct CPackForServer; class IBattleEventsReceiver; class CBattleGameInterface; diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index c859d81b3..aa29b9afc 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -4008,7 +4008,7 @@ bool CGameHandler::isValidObject(const CGObjectInstance *obj) const return vstd::contains(gs->map->objects, obj); } -bool CGameHandler::isBlockedByQueries(const CPack *pack, PlayerColor player) +bool CGameHandler::isBlockedByQueries(const CPackForServer *pack, PlayerColor player) { if (dynamic_cast(pack) != nullptr) return false; diff --git a/server/CGameHandler.h b/server/CGameHandler.h index e4df739a2..9e97fb716 100644 --- a/server/CGameHandler.h +++ b/server/CGameHandler.h @@ -27,7 +27,6 @@ class CCommanderInstance; class EVictoryLossCheckResult; class CRandomGenerator; -struct CPack; struct CPackForServer; struct NewTurn; struct CGarrisonOperationPack; @@ -89,7 +88,7 @@ public: CVCMIServer * gameLobby() const; bool isValidObject(const CGObjectInstance *obj) const; - bool isBlockedByQueries(const CPack *pack, PlayerColor player); + bool isBlockedByQueries(const CPackForServer *pack, PlayerColor player); bool isAllowedExchange(ObjectInstanceID id1, ObjectInstanceID id2); void giveSpells(const CGTownInstance *t, const CGHeroInstance *h); diff --git a/server/queries/BattleQueries.cpp b/server/queries/BattleQueries.cpp index 30b06db91..52fcbd63b 100644 --- a/server/queries/BattleQueries.cpp +++ b/server/queries/BattleQueries.cpp @@ -49,7 +49,7 @@ CBattleQuery::CBattleQuery(CGameHandler * owner): belligerents[BattleSide::DEFENDER] = nullptr; } -bool CBattleQuery::blocksPack(const CPack * pack) const +bool CBattleQuery::blocksPack(const CPackForServer * pack) const { if(dynamic_cast(pack) != nullptr) return false; diff --git a/server/queries/BattleQueries.h b/server/queries/BattleQueries.h index ae32b08b3..3cb525a28 100644 --- a/server/queries/BattleQueries.h +++ b/server/queries/BattleQueries.h @@ -30,7 +30,7 @@ public: CBattleQuery(CGameHandler * owner); CBattleQuery(CGameHandler * owner, const IBattleInfo * Bi); //TODO void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override; - bool blocksPack(const CPack *pack) const override; + bool blocksPack(const CPackForServer *pack) const override; void onRemoval(PlayerColor color) override; void onExposure(QueryPtr topQuery) override; }; diff --git a/server/queries/CQuery.cpp b/server/queries/CQuery.cpp index 3b9d8dd84..26a3b571c 100644 --- a/server/queries/CQuery.cpp +++ b/server/queries/CQuery.cpp @@ -81,7 +81,7 @@ void CQuery::onRemoval(PlayerColor color) } -bool CQuery::blocksPack(const CPack * pack) const +bool CQuery::blocksPack(const CPackForServer * pack) const { return false; } @@ -112,7 +112,7 @@ void CQuery::setReply(std::optional reply) } -bool CQuery::blockAllButReply(const CPack * pack) const +bool CQuery::blockAllButReply(const CPackForServer * pack) const { //We accept only query replies from correct player if(auto reply = dynamic_cast(pack)) @@ -132,7 +132,7 @@ bool CDialogQuery::endsByPlayerAnswer() const return true; } -bool CDialogQuery::blocksPack(const CPack * pack) const +bool CDialogQuery::blocksPack(const CPackForServer * pack) const { return blockAllButReply(pack); } @@ -149,7 +149,7 @@ CGenericQuery::CGenericQuery(CGameHandler * gh, PlayerColor color, std::function addPlayer(color); } -bool CGenericQuery::blocksPack(const CPack * pack) const +bool CGenericQuery::blocksPack(const CPackForServer * pack) const { return blockAllButReply(pack); } diff --git a/server/queries/CQuery.h b/server/queries/CQuery.h index 2fde16295..5cdae43d4 100644 --- a/server/queries/CQuery.h +++ b/server/queries/CQuery.h @@ -13,7 +13,7 @@ VCMI_LIB_NAMESPACE_BEGIN -struct CPack; +struct CPackForServer; class CGObjectInstance; class CGHeroInstance; @@ -43,7 +43,7 @@ public: CQuery(CGameHandler * gh); /// query can block attempting actions by player. Eg. he can't move hero during the battle. - virtual bool blocksPack(const CPack *pack) const; + virtual bool blocksPack(const CPackForServer *pack) const; /// query is removed after player gives answer (like dialogs) virtual bool endsByPlayerAnswer() const; @@ -71,7 +71,7 @@ protected: QueriesProcessor * owner; CGameHandler * gh; void addPlayer(PlayerColor color); - bool blockAllButReply(const CPack * pack) const; + bool blockAllButReply(const CPackForServer * pack) const; }; std::ostream &operator<<(std::ostream &out, const CQuery &query); @@ -82,7 +82,7 @@ class CDialogQuery : public CQuery public: CDialogQuery(CGameHandler * owner); bool endsByPlayerAnswer() const override; - bool blocksPack(const CPack *pack) const override; + bool blocksPack(const CPackForServer *pack) const override; void setReply(std::optional reply) override; protected: std::optional answer; @@ -93,7 +93,7 @@ class CGenericQuery : public CQuery public: CGenericQuery(CGameHandler * gh, PlayerColor color, std::function)> Callback); - bool blocksPack(const CPack * pack) const override; + bool blocksPack(const CPackForServer * pack) const override; bool endsByPlayerAnswer() const override; void onExposure(QueryPtr topQuery) override; void setReply(std::optional reply) override; diff --git a/server/queries/MapQueries.cpp b/server/queries/MapQueries.cpp index 2881368d4..ff83948ad 100644 --- a/server/queries/MapQueries.cpp +++ b/server/queries/MapQueries.cpp @@ -23,7 +23,7 @@ TimerPauseQuery::TimerPauseQuery(CGameHandler * owner, PlayerColor player): addPlayer(player); } -bool TimerPauseQuery::blocksPack(const CPack *pack) const +bool TimerPauseQuery::blocksPack(const CPackForServer *pack) const { return blockAllButReply(pack); } @@ -58,7 +58,7 @@ CGarrisonDialogQuery::CGarrisonDialogQuery(CGameHandler * owner, const CArmedIns addPlayer(down->tempOwner); } -bool CGarrisonDialogQuery::blocksPack(const CPack * pack) const +bool CGarrisonDialogQuery::blocksPack(const CPackForServer * pack) const { std::set ourIds; ourIds.insert(this->exchangingArmies[0]->id); @@ -143,7 +143,7 @@ void OpenWindowQuery::onExposure(QueryPtr topQuery) //do nothing - wait for reply } -bool OpenWindowQuery::blocksPack(const CPack *pack) const +bool OpenWindowQuery::blocksPack(const CPackForServer *pack) const { if (mode == EOpenWindowMode::RECRUITMENT_FIRST || mode == EOpenWindowMode::RECRUITMENT_ALL) { diff --git a/server/queries/MapQueries.h b/server/queries/MapQueries.h index 41b06d3b7..f202e11b7 100644 --- a/server/queries/MapQueries.h +++ b/server/queries/MapQueries.h @@ -25,7 +25,7 @@ class TimerPauseQuery : public CQuery public: TimerPauseQuery(CGameHandler * owner, PlayerColor player); - bool blocksPack(const CPack *pack) const override; + bool blocksPack(const CPackForServer *pack) const override; void onAdding(PlayerColor color) override; void onRemoval(PlayerColor color) override; bool endsByPlayerAnswer() const override; @@ -54,7 +54,7 @@ public: CGarrisonDialogQuery(CGameHandler * owner, const CArmedInstance *up, const CArmedInstance *down); void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override; - bool blocksPack(const CPack *pack) const override; + bool blocksPack(const CPackForServer *pack) const override; }; //yes/no and component selection dialogs @@ -75,7 +75,7 @@ class OpenWindowQuery : public CDialogQuery public: OpenWindowQuery(CGameHandler * owner, const CGHeroInstance *hero, EOpenWindowMode mode); - bool blocksPack(const CPack *pack) const override; + bool blocksPack(const CPackForServer *pack) const override; void onExposure(QueryPtr topQuery) override; }; diff --git a/server/queries/VisitQueries.cpp b/server/queries/VisitQueries.cpp index ea53b3648..36ff95291 100644 --- a/server/queries/VisitQueries.cpp +++ b/server/queries/VisitQueries.cpp @@ -24,7 +24,7 @@ VisitQuery::VisitQuery(CGameHandler * owner, const CGObjectInstance * Obj, const addPlayer(Hero->tempOwner); } -bool VisitQuery::blocksPack(const CPack * pack) const +bool VisitQuery::blocksPack(const CPackForServer * pack) const { //During the visit itself ALL actions are blocked. //(However, the visit may trigger a query above that'll pass some.) diff --git a/server/queries/VisitQueries.h b/server/queries/VisitQueries.h index d2f554a49..fe41df45f 100644 --- a/server/queries/VisitQueries.h +++ b/server/queries/VisitQueries.h @@ -26,7 +26,7 @@ public: const CGObjectInstance * visitedObject; const CGHeroInstance * visitingHero; - bool blocksPack(const CPack * pack) const final; + bool blocksPack(const CPackForServer * pack) const final; }; class MapObjectVisitQuery final : public VisitQuery