mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Added Query to track visit duration for Taverns and Markets
This commit is contained in:
@@ -154,10 +154,13 @@ void AIGateway::artifactAssembled(const ArtifactLocation & al)
|
||||
NET_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
void AIGateway::showTavernWindow(const CGObjectInstance * townOrTavern)
|
||||
void AIGateway::showTavernWindow(const CGObjectInstance * object, const CGHeroInstance * visitor, QueryID queryID)
|
||||
{
|
||||
LOG_TRACE(logAi);
|
||||
NET_EVENT_HANDLER;
|
||||
|
||||
status.addQuery(queryID, "TavernWindow");
|
||||
requestActionASAP([=](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
void AIGateway::showThievesGuildWindow(const CGObjectInstance * obj)
|
||||
@@ -425,10 +428,13 @@ void AIGateway::receivedResource()
|
||||
NET_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
void AIGateway::showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor)
|
||||
void AIGateway::showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID)
|
||||
{
|
||||
LOG_TRACE(logAi);
|
||||
NET_EVENT_HANDLER;
|
||||
|
||||
status.addQuery(queryID, "UniversityWindow");
|
||||
requestActionASAP([=](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
void AIGateway::heroManaPointsChanged(const CGHeroInstance * hero)
|
||||
@@ -498,10 +504,13 @@ void AIGateway::heroBonusChanged(const CGHeroInstance * hero, const Bonus & bonu
|
||||
NET_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
void AIGateway::showMarketWindow(const IMarket * market, const CGHeroInstance * visitor)
|
||||
void AIGateway::showMarketWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID)
|
||||
{
|
||||
LOG_TRACE(logAi);
|
||||
NET_EVENT_HANDLER;
|
||||
|
||||
status.addQuery(queryID, "MarketWindow");
|
||||
requestActionASAP([=](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
void AIGateway::showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositions, bool showTerrain)
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
void tileHidden(const std::unordered_set<int3> & pos) override;
|
||||
void artifactMoved(const ArtifactLocation & src, const ArtifactLocation & dst) override;
|
||||
void artifactAssembled(const ArtifactLocation & al) override;
|
||||
void showTavernWindow(const CGObjectInstance * townOrTavern) override;
|
||||
void showTavernWindow(const CGObjectInstance * object, const CGHeroInstance * visitor, QueryID queryID) override;
|
||||
void showThievesGuildWindow(const CGObjectInstance * obj) override;
|
||||
void playerBlocked(int reason, bool start) override;
|
||||
void showPuzzleMap() override;
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
void requestRealized(PackageApplied * pa) override;
|
||||
void receivedResource() override;
|
||||
void objectRemoved(const CGObjectInstance * obj, const PlayerColor & initiator) override;
|
||||
void showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor) override;
|
||||
void showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID) override;
|
||||
void heroManaPointsChanged(const CGHeroInstance * hero) override;
|
||||
void heroSecondarySkillChanged(const CGHeroInstance * hero, int which, int val) override;
|
||||
void battleResultsApplied() override;
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
void objectPropertyChanged(const SetObjectProperty * sop) override;
|
||||
void buildChanged(const CGTownInstance * town, BuildingID buildingID, int what) override;
|
||||
void heroBonusChanged(const CGHeroInstance * hero, const Bonus & bonus, bool gain) override;
|
||||
void showMarketWindow(const IMarket * market, const CGHeroInstance * visitor) override;
|
||||
void showMarketWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID) override;
|
||||
void showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositions, bool showTerrain) override;
|
||||
std::optional<BattleAction> makeSurrenderRetreatDecision(const BattleID & battleID, const BattleStateInfoForRetreat & battleState) override;
|
||||
|
||||
|
||||
@@ -165,10 +165,13 @@ void VCAI::artifactAssembled(const ArtifactLocation & al)
|
||||
NET_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
void VCAI::showTavernWindow(const CGObjectInstance * townOrTavern)
|
||||
void VCAI::showTavernWindow(const CGObjectInstance * object, const CGHeroInstance * visitor, QueryID queryID)
|
||||
{
|
||||
LOG_TRACE(logAi);
|
||||
NET_EVENT_HANDLER;
|
||||
|
||||
status.addQuery(queryID, "TavernWindow");
|
||||
requestActionASAP([=](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
void VCAI::showThievesGuildWindow(const CGObjectInstance * obj)
|
||||
@@ -512,10 +515,13 @@ void VCAI::receivedResource()
|
||||
NET_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
void VCAI::showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor)
|
||||
void VCAI::showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID)
|
||||
{
|
||||
LOG_TRACE(logAi);
|
||||
NET_EVENT_HANDLER;
|
||||
|
||||
status.addQuery(queryID, "UniversityWindow");
|
||||
requestActionASAP([=](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
void VCAI::heroManaPointsChanged(const CGHeroInstance * hero)
|
||||
@@ -577,10 +583,13 @@ void VCAI::heroBonusChanged(const CGHeroInstance * hero, const Bonus & bonus, bo
|
||||
NET_EVENT_HANDLER;
|
||||
}
|
||||
|
||||
void VCAI::showMarketWindow(const IMarket * market, const CGHeroInstance * visitor)
|
||||
void VCAI::showMarketWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID)
|
||||
{
|
||||
LOG_TRACE(logAi);
|
||||
NET_EVENT_HANDLER;
|
||||
|
||||
status.addQuery(queryID, "MarketWindow");
|
||||
requestActionASAP([=](){ answerQuery(queryID, 0); });
|
||||
}
|
||||
|
||||
void VCAI::showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositions, bool showTerrain)
|
||||
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
void tileHidden(const std::unordered_set<int3> & pos) override;
|
||||
void artifactMoved(const ArtifactLocation & src, const ArtifactLocation & dst) override;
|
||||
void artifactAssembled(const ArtifactLocation & al) override;
|
||||
void showTavernWindow(const CGObjectInstance * townOrTavern) override;
|
||||
void showTavernWindow(const CGObjectInstance * object, const CGHeroInstance * visitor, QueryID queryID) override;
|
||||
void showThievesGuildWindow(const CGObjectInstance * obj) override;
|
||||
void playerBlocked(int reason, bool start) override;
|
||||
void showPuzzleMap() override;
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
void requestRealized(PackageApplied * pa) override;
|
||||
void receivedResource() override;
|
||||
void objectRemoved(const CGObjectInstance * obj, const PlayerColor & initiator) override;
|
||||
void showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor) override;
|
||||
void showUniversityWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID) override;
|
||||
void heroManaPointsChanged(const CGHeroInstance * hero) override;
|
||||
void heroSecondarySkillChanged(const CGHeroInstance * hero, int which, int val) override;
|
||||
void battleResultsApplied() override;
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
void objectPropertyChanged(const SetObjectProperty * sop) override;
|
||||
void buildChanged(const CGTownInstance * town, BuildingID buildingID, int what) override;
|
||||
void heroBonusChanged(const CGHeroInstance * hero, const Bonus & bonus, bool gain) override;
|
||||
void showMarketWindow(const IMarket * market, const CGHeroInstance * visitor) override;
|
||||
void showMarketWindow(const IMarket * market, const CGHeroInstance * visitor, QueryID queryID) override;
|
||||
void showWorldViewEx(const std::vector<ObjectPosInfo> & objectPositions, bool showTerrain) override;
|
||||
|
||||
void battleStart(const BattleID & battleID, const CCreatureSet * army1, const CCreatureSet * army2, int3 tile, const CGHeroInstance * hero1, const CGHeroInstance * hero2, bool side, bool replayAllowed) override;
|
||||
|
||||
Reference in New Issue
Block a user