Compare commits

...
Author SHA1 Message Date
adminandClaude Opus 4.5 12b87dabc4 Client: send JoinGameRequest on reconnect to preload game
Send JoinGameRequest before StreamGameRequest in StreamOneGameAsync.
For already-started games, this returns GAME_FULL but triggers game
loading on the server, preventing "key not found" errors on subsequent
commands.

Requires server-side change to call ensureGameLoaded() in joinGame's
case None branch (#5339).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 18:04:24 -08:00
@@ -196,6 +196,20 @@ namespace eagle {
/// </summary>
private async Task<bool> StreamOneGameAsync(IClientConnectionSubscriber subscriber) {
var gameId = subscriber.GameId;
// Send JoinGameRequest first to ensure game is loaded on server.
// For already-started games, this returns GAME_FULL but still triggers
// game loading, which prevents "key not found" errors on subsequent commands.
var joinRequest = new UpdateStreamRequest {
JoinGameRequest = new JoinGameRequest { GameId = gameId }
};
await DoWithStreamingCall(async (sc) => {
await sc.RequestStream.WriteAsync(joinRequest);
_remoteEagleClientLogger.LogLine(
$"[SUBSCRIBE] Sent JoinGameRequest for game {gameId} to ensure game is loaded");
return true;
});
var streamGameRequest = new StreamGameRequest {
GameId = gameId,
UnfilteredResultCount = subscriber.LastUnfilteredResultCount