Skip to content

[2308] Keep initiating player battle rewards - #2328

Merged
ShoT-UPfps merged 18 commits into
developmentfrom
2308/fix-initiator-battle-rewards
Jul 27, 2026
Merged

[2308] Keep initiating player battle rewards#2328
ShoT-UPfps merged 18 commits into
developmentfrom
2308/fix-initiator-battle-rewards

Conversation

@ShoT-UPfps

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • All new classes have class-level documentation comments, if there are any at all
  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation update
  • Other... Please describe:

What is the current behavior?

Starting a battle gives the initiating player no loot or prisoners when another player joins later, while the joining player receives almost all of the rewards.

What is the new behavior?

Resolves #2308

Starting a battle keeps the initiating player's contribution attached to the correct troops after another player joins, so both players receive their own share of loot and prisoners at victory.

Bot Changelog Entry

  • Fixes battle rewards for the player who starts a battle when another player joins later.

Resolve the attacking troop against the current map-event roster before applying score hits, so a late join cannot redirect the initiating player's contribution and rewards.
…ator-battle-rewards

# Conflicts:
#	source/GameInterface/Services/MapEvents/Commands/MapEventDebugCommands.cs
Late-joining clients can hold a different PartyBase identity from the registered map-event party. Prefer the registered party owned by this client so mission reserves bind to the correct local origin.
The live-test oracle previously inferred both participants from each client local map event, but a late joiner can have a partial involved-party view while the mission scoreboard already contains both players. Report the scoreboard-derived player-party count so the exact scenario observes the UI state it is intended to prove.
Late-join clients can retain a partial MapEventParty graph even after the server has calculated rewards for every participant. Carry the receiver side in the result and unpack only the loot addressed to that stable party id so reward staging does not depend on the local replica graph.
The result handler already owns the game-thread boundary through RunSafe. Unpack the receiver-specific rosters inline so failures stay under that guard and no nested blocking call obscures the synchronous out parameters.
@ShoT-UPfps
ShoT-UPfps marked this pull request as ready for review July 27, 2026 13:56
@ShoT-UPfps

Copy link
Copy Markdown
Contributor Author

fake codefactors

@ShoT-UPfps
ShoT-UPfps requested a review from garrettluskey July 27, 2026 13:56
@ShoT-UPfps
ShoT-UPfps merged commit 1a4f53e into development Jul 27, 2026
13 of 14 checks passed
@ShoT-UPfps
ShoT-UPfps deleted the 2308/fix-initiator-battle-rewards branch July 27, 2026 21:11
@github-project-automation github-project-automation Bot moved this from Todo to Done in Sync Backlog Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BATTLES] The initiating player receives no loot or prisoners

2 participants