diff --git a/Game/Dungeon/DungeonHandler.cs b/Game/Dungeon/DungeonHandler.cs index 2d91484..03e66d0 100644 --- a/Game/Dungeon/DungeonHandler.cs +++ b/Game/Dungeon/DungeonHandler.cs @@ -2320,6 +2320,40 @@ public sealed partial class DungeonHandler : IClientMessageHandler session.CurrentDungeonId = instance.Id; session.PlayerInstance = player; + // Build visual tile data if V2 layout available + object? tileSheets = null; + object? visualTiles = null; + + if (instance.LayoutV2 != null && instance.LayoutV2.TileDetails.Count > 0) + { + tileSheets = instance.LayoutV2.TileMapSheets.Select(s => new + { + id = s.Id, + path = s.CdnPath, + tileW = s.TileWidth, + tileH = s.TileHeight, + sheetW = s.SheetWidth, + sheetH = s.SheetHeight, + cols = s.Columns + }).ToArray(); + + visualTiles = instance.LayoutV2.TileDetails.Select(t => new + { + x = t.X, + y = t.Y, + tid = t.TileDefinitionId, + sid = t.SheetId, + frame = t.FrameIndex, + l = t.Layer, + r = t.Rotation, + fx = t.FlipX, + fy = t.FlipY + }).ToArray(); + + _log.LogInformation("Sending {SheetCount} sheets, {TileCount} visual tiles to client", + instance.LayoutV2.TileMapSheets.Count, instance.LayoutV2.TileDetails.Count); + } + await SendAsync(connection, DungeonOpCodes.DUNGEON_ENTER_RESULT, new { ok = true, @@ -2367,7 +2401,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler x = p.X, y = p.Y, type = p.Type.ToString().ToLower() - }) + }), + // V2 visual tile data + tileSheets, + visualTiles }, ct); _log.LogInformation("Player {Name} (Level {Level}) joined dungeon {Id}",