Remove [RULES] diagnostic logging (issue confirmed fixed)
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
namespace SOR.Game.Handlers;
|
namespace SOR.Game.Handlers;
|
||||||
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using SOR.Database.Contexts;
|
using SOR.Database.Contexts;
|
||||||
using SOR.Database.Entities.Catalog;
|
using SOR.Database.Entities.Catalog;
|
||||||
using SOR.Database.Entities.Collection;
|
using SOR.Database.Entities.Collection;
|
||||||
@@ -24,22 +23,19 @@ internal sealed class GameReadyHandler : GameHandlerBase, IMessageHandler
|
|||||||
private readonly CollectionDbContext _collectionDb;
|
private readonly CollectionDbContext _collectionDb;
|
||||||
private readonly CatalogDbContext _catalogDb;
|
private readonly CatalogDbContext _catalogDb;
|
||||||
private readonly IClientPush _clientPush;
|
private readonly IClientPush _clientPush;
|
||||||
private readonly ILogger<GameReadyHandler> _logger;
|
|
||||||
|
|
||||||
public GameReadyHandler(
|
public GameReadyHandler(
|
||||||
IMessageSerializer serializer,
|
IMessageSerializer serializer,
|
||||||
GameDbContext gameDb,
|
GameDbContext gameDb,
|
||||||
CollectionDbContext collectionDb,
|
CollectionDbContext collectionDb,
|
||||||
CatalogDbContext catalogDb,
|
CatalogDbContext catalogDb,
|
||||||
IClientPush clientPush,
|
IClientPush clientPush)
|
||||||
ILogger<GameReadyHandler> logger)
|
|
||||||
{
|
{
|
||||||
_serializer = serializer;
|
_serializer = serializer;
|
||||||
_gameDb = gameDb;
|
_gameDb = gameDb;
|
||||||
_collectionDb = collectionDb;
|
_collectionDb = collectionDb;
|
||||||
_catalogDb = catalogDb;
|
_catalogDb = catalogDb;
|
||||||
_clientPush = clientPush;
|
_clientPush = clientPush;
|
||||||
_logger = logger;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string MessageType => "game.ready";
|
public string MessageType => "game.ready";
|
||||||
@@ -102,21 +98,10 @@ internal sealed class GameReadyHandler : GameHandlerBase, IMessageHandler
|
|||||||
var p2ArchSpirit = await LoadDeckArchSpiritAsync(session.PlayerTwoDeckId, ct);
|
var p2ArchSpirit = await LoadDeckArchSpiritAsync(session.PlayerTwoDeckId, ct);
|
||||||
|
|
||||||
// Deserialize rule snapshot (falls back to default if none stored).
|
// Deserialize rule snapshot (falls back to default if none stored).
|
||||||
_logger.LogInformation(
|
|
||||||
"[RULES] Session {SessionId} RuleSnapshotJson: {Snippet}",
|
|
||||||
session.Id,
|
|
||||||
session.RuleSnapshotJson is null ? "<null>" : session.RuleSnapshotJson[..Math.Min(300, session.RuleSnapshotJson.Length)]);
|
|
||||||
|
|
||||||
var rules = session.RuleSnapshotJson is not null
|
var rules = session.RuleSnapshotJson is not null
|
||||||
? GameEngine.DeserializeRules(session.RuleSnapshotJson)
|
? GameEngine.DeserializeRules(session.RuleSnapshotJson)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
_logger.LogInformation(
|
|
||||||
"[RULES] Deserialized StartingRandomTilePct={Pct} BoardWidth={W} BoardHeight={H}",
|
|
||||||
rules?.StartingRandomTilePct ?? GameRules.Default.StartingRandomTilePct,
|
|
||||||
rules?.BoardWidth ?? GameRules.Default.BoardWidth,
|
|
||||||
rules?.BoardHeight ?? GameRules.Default.BoardHeight);
|
|
||||||
|
|
||||||
var state = GameEngine.Initialize(
|
var state = GameEngine.Initialize(
|
||||||
session.Id,
|
session.Id,
|
||||||
session.PlayerOneAccountId, p1DeckCards, p1ArchSpirit,
|
session.PlayerOneAccountId, p1DeckCards, p1ArchSpirit,
|
||||||
|
|||||||
@@ -110,11 +110,6 @@ internal sealed class MatchmakerService : BackgroundService
|
|||||||
.Where(r => r.IsRankedDefault)
|
.Where(r => r.IsRankedDefault)
|
||||||
.FirstOrDefaultAsync(ct);
|
.FirstOrDefaultAsync(ct);
|
||||||
|
|
||||||
_logger.LogInformation(
|
|
||||||
"[RULES] Ranked rules loaded: found={Found} StartingRandomTilePct={Pct}",
|
|
||||||
rankedRules is not null,
|
|
||||||
rankedRules?.StartingRandomTilePct);
|
|
||||||
|
|
||||||
// Create a game session.
|
// Create a game session.
|
||||||
var session = new GameSession
|
var session = new GameSession
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user