Logging Change for EF Core, and Simulation fix
This commit is contained in:
@@ -3075,8 +3075,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
|||||||
_log.LogInformation("Preserving {Count} mobs with carried player loot during respawn", mobsWithLoot.Count);
|
_log.LogInformation("Preserving {Count} mobs with carried player loot during respawn", mobsWithLoot.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a fresh simulation with the same parameters
|
// IMPORTANT: Reuse the existing layout to preserve mob spawn positions!
|
||||||
var layout = DungeonGenerator.Generate(instance.Seed, instance.Tier);
|
// Using DungeonGenerator.Generate() would create a V1 layout which has different
|
||||||
|
// room geometry than V2/V3, causing mobs to spawn in wrong positions.
|
||||||
|
var layout = instance.Simulation.Layout;
|
||||||
var freshSimulation = new DungeonSimulation(layout, instance.Tier, _mobDefinitions, instance.LevelBracketMin, null, _mobSpriteConfigs);
|
var freshSimulation = new DungeonSimulation(layout, instance.Tier, _mobDefinitions, instance.LevelBracketMin, null, _mobSpriteConfigs);
|
||||||
|
|
||||||
// Clear and rebuild mobs, keeping those with loot
|
// Clear and rebuild mobs, keeping those with loot
|
||||||
|
|||||||
@@ -605,14 +605,14 @@ public partial class DungeonSimulation
|
|||||||
float distance = Distance(projectile.X, projectile.Y, mob.X, mob.Y);
|
float distance = Distance(projectile.X, projectile.Y, mob.X, mob.Y);
|
||||||
|
|
||||||
// Debug: Log every projectile-mob distance check
|
// Debug: Log every projectile-mob distance check
|
||||||
if (Projectiles.Count > 0 && projectile.Id % 10 == 0) // Log every 10th projectile to reduce spam
|
//if (Projectiles.Count > 0 && projectile.Id % 10 == 0) // Log every 10th projectile to reduce spam
|
||||||
{
|
//{
|
||||||
Console.WriteLine($"[Projectile {projectile.Id}] Pos: ({projectile.X:F1}, {projectile.Y:F1}), Mob {mob.Id} Pos: ({mob.X:F1}, {mob.Y:F1}), Distance: {distance:F1}");
|
// Console.WriteLine($"[Projectile {projectile.Id}] Pos: ({projectile.X:F1}, {projectile.Y:F1}), Mob {mob.Id} Pos: ({mob.X:F1}, {mob.Y:F1}), Distance: {distance:F1}");
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (distance < 50) // Increased from 20 to account for projectile speed (15px/tick movement)
|
if (distance < 50) // Increased from 20 to account for projectile speed (15px/tick movement)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"[Projectile {projectile.Id}] HIT mob {mob.Id} at distance {distance:F1}! Damage: {projectile.Damage}");
|
//Console.WriteLine($"[Projectile {projectile.Id}] HIT mob {mob.Id} at distance {distance:F1}! Damage: {projectile.Damage}");
|
||||||
// Get player instance for damage calculation
|
// Get player instance for damage calculation
|
||||||
PlayerInstance? sourcePlayer = null;
|
PlayerInstance? sourcePlayer = null;
|
||||||
if (Players.TryGetValue(projectile.SourcePlayerId, out var playerInst))
|
if (Players.TryGetValue(projectile.SourcePlayerId, out var playerInst))
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore.Database.Command": "Warning"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
|
|||||||
Reference in New Issue
Block a user