Dungeon Builder p5
This commit is contained in:
@@ -741,6 +741,39 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
||||
session.CurrentDungeonId = dungeonId;
|
||||
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
|
||||
});
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
_log.LogInformation("Sending {TileCount} visual tiles to client", instance.LayoutV2.TileDetails.Count);
|
||||
}
|
||||
|
||||
await SendAsync(connection, DungeonOpCodes.DUNGEON_ENTER_RESULT, new
|
||||
{
|
||||
ok = true,
|
||||
@@ -781,7 +814,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user