Fixing Clear Dungeon
This commit is contained in:
@@ -673,6 +673,17 @@ public sealed class DungeonHandler : IClientMessageHandler
|
|||||||
.Where(s => s.CurrentDungeonId == dungeonId && s.State == PlayerState.InDungeon)
|
.Where(s => s.CurrentDungeonId == dungeonId && s.State == PlayerState.InDungeon)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
// Check if dungeon was just cleared
|
||||||
|
if (result.Phase == DungeonPhase.Cleared && !instance.ClearedHandled)
|
||||||
|
{
|
||||||
|
instance.ClearedHandled = true;
|
||||||
|
foreach (var session in playersInDungeon)
|
||||||
|
{
|
||||||
|
_ = HandleDungeonClearedAsync(session);
|
||||||
|
}
|
||||||
|
continue; // Skip normal state updates since we're returning everyone to hub
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var session in playersInDungeon)
|
foreach (var session in playersInDungeon)
|
||||||
{
|
{
|
||||||
// Check escape completion (5 seconds = 100 ticks)
|
// Check escape completion (5 seconds = 100 ticks)
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ public class DungeonInstance
|
|||||||
public int Seed { get; set; }
|
public int Seed { get; set; }
|
||||||
public DungeonSimulation Simulation { get; set; } = null!;
|
public DungeonSimulation Simulation { get; set; } = null!;
|
||||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||||
|
public bool ClearedHandled { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user