[Server][Game][Arrows] Properly notify clients when deleting arrows on card move and transform into (#6936)

* [Server][Game][Arrows] Properly notify clients when deleting arrows on card move and transform into

Took 15 minutes

* Observe "not found" response

Took 18 minutes

Took 4 seconds

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-05-25 08:19:17 +02:00 committed by GitHub
parent 98c00c55ed
commit 90ab663212
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 8 deletions

View file

@ -217,7 +217,20 @@ void GameEventHandler::handleArrowDeletion(int arrowId)
{
Command_DeleteArrow cmd;
cmd.set_arrow_id(arrowId);
sendGameCommand(cmd);
auto preparedCommand = prepareGameCommand(cmd);
connect(preparedCommand, &PendingCommand::finished, this,
[arrowId, this](const Response &response) { handleArrowDeletionFinished(response, arrowId); });
sendGameCommand(preparedCommand);
}
void GameEventHandler::handleArrowDeletionFinished(const Response &response, int arrowId)
{
if (response.response_code() == Response::RespNameNotFound) {
emit arrowDeleted(arrowId);
}
}
void GameEventHandler::eventSpectatorSay(const Event_GameSay &event,