You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GET /customCharacter returns the logged-in player’s custom characters.
CustomCharacter.player_id identifies the owning player.
CustomCharacter.attack is returned as the current total attack value.
PUT /customCharacter updates character stats in CustomCharacterController.update.
Battle completion already emits ServerTaskName.GO_TO_BATTLE from GameEventsHandler.handleWinBattle and handleLoseBattle.
Suggested backend flow:
flowchart TD
A[Reserved task: stronger_soldier] --> B[PUT /customCharacter]
B --> C[Read previous CustomCharacter stats]
C --> D[Update CustomCharacter]
D --> E{Is this player's own defence soldier<br/>and did attack increase?}
E -->|No| F[No stronger_soldier progress]
E -->|Yes| G[Progress stronger_soldier step 1<br/>amountLeft 2 -> 1]
G --> H[MQTT TASK_UPDATED]
H --> I[Player plays battle]
I --> J[Battle win/loss event]
J --> K{Reserved stronger_soldier<br/>with step 1 already done?}
K -->|No| L[No stronger_soldier completion]
K -->|Yes| M[Complete stronger_soldier<br/>amountLeft 1 -> 0]
M --> N[Player/clan rewards]
N --> O[MQTT TASK_COMPLETED + CLAN_TASK_COMPLETED]
Loading
Implementation detail suggestion:
In CustomCharacterController.update / CustomCharacterService, compare the character’s previous attack value to the new attack value before/after update.
Only progress stronger_soldier if:
the logged-in player owns the character,
the active reserved daily task is stronger_soldier,
the updated character is a defence soldier,
attack increased.
Set stronger_soldier.amount = 2, so step 1 leaves amountLeft = 1.
Do not complete the task during the stat update.
On battle win/loss handling, complete stronger_soldier only if it is the player’s active reserved task and amountLeft === 1.
Preserve the existing GO_TO_BATTLE behavior for the normal go_to_battle task.
Any additional info?
Note that CustomCharacterService.addValues() adds base stats to stored stat deltas before returning characters. So attack comparison should be done carefully: either compare normalized total values or compare stored deltas consistently.
What do you want to see in the API?
The task should progress when the reserved player:
attackvalue of their own defence soldier throughPUT /customCharacter.The API should send normal daily task MQTT progress/completion notifications:
/player/{playerId}/daily_task/stronger_soldier/update/player/{playerId}/daily_task/stronger_soldier/end/clan/{clanId}/daily_task/stronger_soldier/end/clan/{clanId}/daily_task/milestone/updateHow do you think this should work?
Current code already has the useful pieces:
ServerTaskName.STRONGER_SOLDIER = 'stronger_soldier'GET /customCharacterreturns the logged-in player’s custom characters.CustomCharacter.player_ididentifies the owning player.CustomCharacter.attackis returned as the current total attack value.PUT /customCharacterupdates character stats inCustomCharacterController.update.ServerTaskName.GO_TO_BATTLEfromGameEventsHandler.handleWinBattleandhandleLoseBattle.Suggested backend flow:
flowchart TD A[Reserved task: stronger_soldier] --> B[PUT /customCharacter] B --> C[Read previous CustomCharacter stats] C --> D[Update CustomCharacter] D --> E{Is this player's own defence soldier<br/>and did attack increase?} E -->|No| F[No stronger_soldier progress] E -->|Yes| G[Progress stronger_soldier step 1<br/>amountLeft 2 -> 1] G --> H[MQTT TASK_UPDATED] H --> I[Player plays battle] I --> J[Battle win/loss event] J --> K{Reserved stronger_soldier<br/>with step 1 already done?} K -->|No| L[No stronger_soldier completion] K -->|Yes| M[Complete stronger_soldier<br/>amountLeft 1 -> 0] M --> N[Player/clan rewards] N --> O[MQTT TASK_COMPLETED + CLAN_TASK_COMPLETED]Implementation detail suggestion:
CustomCharacterController.update/CustomCharacterService, compare the character’s previousattackvalue to the newattackvalue before/after update.stronger_soldierif:stronger_soldier,attackincreased.stronger_soldier.amount = 2, so step 1 leavesamountLeft = 1.stronger_soldieronly if it is the player’s active reserved task andamountLeft === 1.GO_TO_BATTLEbehavior for the normalgo_to_battletask.Any additional info?
Note that
CustomCharacterService.addValues()adds base stats to stored stat deltas before returning characters. So attack comparison should be done carefully: either compare normalized total values or compare stored deltas consistently.