Add BattleResetResponse proto messages (#6534)

* Add BattleResetResponse proto messages for tutorial battle reset

Add BattleResetResponse to the internal Shardok interface (oneof case 4
in GameStatusResponse) and ShardokBattleResetResponse to the client-facing
Eagle API (oneof case 8 in GameUpdate). These signal that a tutorial battle
should reset after the defender loses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add no-op handler for BattleResetResponse in exhaustive match

Prevents -Werror build failure from non-exhaustive pattern match
after adding the new oneof case. Full handling in follow-up PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 22:11:57 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent fc0edc38ef
commit e7f9f5cc35
3 changed files with 12 additions and 0 deletions
@@ -55,12 +55,15 @@ message PlacementCommandsRequest {
GameSetupInfo game_setup_info = 6;
}
message BattleResetResponse {}
message GameStatusResponse {
string game_id = 1;
oneof Specific {
GameOverResponse game_over_response = 2;
GameUpdateResponse game_update_response = 3;
BattleResetResponse battle_reset_response = 4;
}
}
@@ -166,6 +166,7 @@ message GameUpdate {
ShardokActionResultResponse shardok_action_result_response = 4;
StreamingTextResponse streaming_text_response = 5;
ErrorResponse error_response = 6;
ShardokBattleResetResponse shardok_battle_reset_response = 8;
}
// Server game status - included with any update type when status changes
@@ -331,6 +332,12 @@ message ShardokActionResultResponse {
repeated SingleShardokGameResultResponse shardok_game_responses = 1;
}
// Signal to the client that a tutorial battle has reset (defender lost, battle restarting).
// The client should clear all Shardok battle state for this game ID and prepare for fresh updates.
message ShardokBattleResetResponse {
string shardok_game_id = 1;
}
message ErrorResponse {
SelectedCommand selected_command = 1;
string error_string = 2;
@@ -224,6 +224,8 @@ class ShardokInterfaceGrpcClient(
)
)
// Note: No polling needed - updates are pushed via stream
case Specific.BattleResetResponse(_) =>
// Tutorial battle reset - full handling in follow-up PR
case Specific.Empty =>
// Empty response - nothing to process
}