Fixing Escape
This commit is contained in:
@@ -646,7 +646,7 @@ public sealed class DungeonHandler : IClientMessageHandler
|
||||
foreach (var session in playersInDungeon)
|
||||
{
|
||||
// Check escape completion (5 seconds = 100 ticks)
|
||||
if (session.IsEscaping && _currentTick - session.EscapeStartTick >= 100)
|
||||
if (session.IsEscaping && _currentTick - session.EscapeStartTick >= 400)
|
||||
{
|
||||
_ = CompleteEscapeAsync(session);
|
||||
continue;
|
||||
@@ -1199,6 +1199,29 @@ public sealed class DungeonHandler : IClientMessageHandler
|
||||
await RemoveFromDungeonAsync(session, true, CancellationToken.None);
|
||||
await SendAsync(session.Connection, DungeonOpCodes.HUB_STATE, GetHubState(session.Character), CancellationToken.None);
|
||||
}
|
||||
/// <summary>
|
||||
/// Handle dungeon cleared - return player to hub with all loot
|
||||
/// </summary>
|
||||
private async Task HandleDungeonClearedAsync(DungeonPlayerSession session)
|
||||
{
|
||||
_log.LogInformation("Dungeon cleared! Returning player {Name} to hub", session.Character.Name);
|
||||
|
||||
// Send dungeon cleared notification
|
||||
await SendAsync(session.Connection, DungeonOpCodes.DUNGEON_STATE, new
|
||||
{
|
||||
phase = "cleared",
|
||||
message = "Dungeon cleared! All enemies defeated."
|
||||
}, CancellationToken.None);
|
||||
|
||||
// Small delay to let client see the message
|
||||
await Task.Delay(2000);
|
||||
|
||||
// Remove from dungeon (extracted = true, so they keep XP and loot)
|
||||
await RemoveFromDungeonAsync(session, true, CancellationToken.None);
|
||||
|
||||
// Send hub state
|
||||
await SendAsync(session.Connection, DungeonOpCodes.HUB_STATE, GetHubState(session.Character), CancellationToken.None);
|
||||
}
|
||||
|
||||
private async Task HandlePlayerDeathAsync(DungeonPlayerSession session)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@ public static class DungeonOpCodes
|
||||
public const int EVENT_LEVELUP = 502;
|
||||
public const int EVENT_LOOT = 503;
|
||||
public const int LOOT_RECEIVED = 160;
|
||||
public const int DUNGEON_CLEARED = 304;
|
||||
|
||||
// Inventory (250-259)
|
||||
public const int INVENTORY_REQUEST = 250;
|
||||
|
||||
Reference in New Issue
Block a user