mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 04:05:44 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9df86a3d8d |
@@ -424,10 +424,17 @@ namespace eagle {
|
||||
var newCount = update.ActionResultResponse.UnfilteredResultCountAfter;
|
||||
lock (_resultCountLock) {
|
||||
var oldCount = _lastUnfilteredResultCount;
|
||||
_lastUnfilteredResultCount = newCount;
|
||||
if (newCount != oldCount) {
|
||||
// Only update if new count is higher. The server sends 0 for
|
||||
// intermediate chunks when splitting large result sets, which we
|
||||
// should ignore to prevent false sync mismatches.
|
||||
if (newCount > oldCount) {
|
||||
_lastUnfilteredResultCount = newCount;
|
||||
_connectionLogger.LogLine(
|
||||
$"[RESULT_COUNT] Updated count {oldCount} -> {newCount}");
|
||||
} else if (newCount < oldCount && newCount != 0) {
|
||||
// Unexpected: count decreased (but not to 0, which is chunking)
|
||||
_connectionLogger.LogLine(
|
||||
$"[RESULT_COUNT] WARNING: Ignoring count decrease {oldCount} -> {newCount}");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -435,7 +442,16 @@ namespace eagle {
|
||||
case GameUpdate.GameUpdateDetailsOneofCase.ShardokActionResultResponse:
|
||||
foreach (var response in update.ShardokActionResultResponse
|
||||
.ShardokGameResponses) {
|
||||
_shardokResultCounts[response.ShardokGameId] = response.NewResultViewCount;
|
||||
var shardokId = response.ShardokGameId;
|
||||
var newShardokCount = response.NewResultViewCount;
|
||||
var oldShardokCount = _shardokResultCounts.GetValueOrDefault(shardokId, 0);
|
||||
// Only update if new count is higher (count should only increase)
|
||||
if (newShardokCount > oldShardokCount) {
|
||||
_shardokResultCounts[shardokId] = newShardokCount;
|
||||
} else if (newShardokCount < oldShardokCount) {
|
||||
_connectionLogger.LogLine(
|
||||
$"[SHARDOK_COUNT] WARNING: Ignoring count decrease for {shardokId}: {oldShardokCount} -> {newShardokCount}");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user