1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Added PackageReceived message to show when server starts pack processing

This commit is contained in:
Ivan Savenko
2025-06-24 18:18:18 +03:00
parent 7fcb0246fb
commit 6b382a979a
6 changed files with 69 additions and 13 deletions

View File

@@ -481,14 +481,23 @@ void CGameHandler::handleReceivedPack(std::shared_ptr<CConnection> connection, C
//prepare struct informing that action was applied
auto sendPackageResponse = [&](bool successfullyApplied)
{
PackageApplied applied;
applied.player = pack.player;
applied.result = successfullyApplied;
applied.packType = CTypeList::getInstance().getTypeID(&pack);
applied.requestID = pack.requestID;
PackageApplied applied(
pack.player,
pack.requestID,
CTypeList::getInstance().getTypeID(&pack),
successfullyApplied
);
connection->sendPack(applied);
};
PackageReceived received(
pack.player,
pack.requestID,
CTypeList::getInstance().getTypeID(&pack)
);
connection->sendPack(received);
if(isBlockedByQueries(&pack, pack.player))
{
sendPackageResponse(false);