mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user