Snapshot for release 2026.10.6.3 (internal f2255d0)
This commit is contained in:
parent
dafd6084a7
commit
bf702ebc67
3 changed files with 29 additions and 14 deletions
|
|
@ -335,6 +335,9 @@ public class BuffManager : IDisposable
|
|||
// then the swap gate's flat 3 s). The pack move stays as the fallback: once a use hasn't
|
||||
// got the wand into the hand in WieldResolveTimeoutMs, this session moves the weapon first.
|
||||
private bool _directWandSwapFailed;
|
||||
// The swap gate's claim count when the wand's use went out: a later claim means another swap
|
||||
// (combat putting the axe back, 12:39 on 10-06) changed the hands, so the result says nothing.
|
||||
private long _pendingWieldClaim;
|
||||
private int _bowDequipPendingId;
|
||||
private DateTime _bowDequipAt = DateTime.MinValue;
|
||||
private int _bowDequipAttempts;
|
||||
|
|
@ -3900,6 +3903,11 @@ public class BuffManager : IDisposable
|
|||
if ((now - _pendingWieldAt).TotalMilliseconds < WieldResolveTimeoutMs)
|
||||
return false;
|
||||
|
||||
if (_weaponSwapGate != null && _weaponSwapGate.Claims != _pendingWieldClaim)
|
||||
{
|
||||
_pendingWieldId = 0; // another swap since ours: not a failed wield
|
||||
return false;
|
||||
}
|
||||
int stillInHand = _directWandSwapFailed ? 0 : FindWieldedNonWandWeapon(wandId);
|
||||
if (stillInHand != 0 && IsWieldedLive(stillInHand))
|
||||
{
|
||||
|
|
@ -3981,6 +3989,7 @@ public class BuffManager : IDisposable
|
|||
|
||||
_host.UseFor((uint)wandId, "Buff", bowId != 0 && !_directWandSwapFailed ? "buffing: switch to the wand" : "buffing: wield the wand");
|
||||
NoteStanceRequest();
|
||||
_pendingWieldClaim = _weaponSwapGate?.Claims ?? 0;
|
||||
_pendingWieldId = wandId;
|
||||
_pendingWieldAt = now;
|
||||
_lastCastAttempt = now;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,10 @@ public sealed class WeaponSwapGate
|
|||
private long _lastSwapTickMs = long.MinValue / 4;
|
||||
private string _lastSwapBy = "";
|
||||
private int _movingId;
|
||||
private bool _movingWasWielded;
|
||||
private long _claims;
|
||||
|
||||
/// <summary>Swaps claimed so far: a caller can tell whether another swap went out after its own.</summary>
|
||||
public long Claims { get { lock (_lock) { return _claims; } } }
|
||||
|
||||
/// <summary>
|
||||
/// The longest one swap holds the next: a swap the server's answer can't be seen for (or
|
||||
|
|
@ -65,22 +68,21 @@ public sealed class WeaponSwapGate
|
|||
_lastSwapTickMs = now;
|
||||
_lastSwapBy = requestedBy ?? "";
|
||||
_movingId = 0;
|
||||
_claims++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The claimed swap moved <paramref name="itemId"/> into or out of a hand without a use (a
|
||||
/// pack move or a slot wield, which the server answers with no UseDone): the swap is done
|
||||
/// once the item's wielded state is no longer <paramref name="wieldedNow"/>.
|
||||
/// pack move or a slot wield): the next swap waits the full MinIntervalMs, as before.
|
||||
/// Drakkon 2026-10-06 13:58: the wand went out 1.3 s after the axe's pack move (the axe read
|
||||
/// out of hand) and the server then held the first cast open until a relog. The server's
|
||||
/// unwield motion outlasts the item move, and nothing tells us when it ends.
|
||||
/// </summary>
|
||||
public void NoteMove(int itemId, bool wieldedNow)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_movingId = itemId;
|
||||
_movingWasWielded = wieldedNow;
|
||||
}
|
||||
lock (_lock) _movingId = itemId;
|
||||
}
|
||||
|
||||
private bool LastSwapDone(long since)
|
||||
|
|
@ -88,8 +90,7 @@ public sealed class WeaponSwapGate
|
|||
if (since < FloorMs || ServerIdle == null || IsWielded == null) return false;
|
||||
try
|
||||
{
|
||||
if (!ServerIdle()) return false;
|
||||
return _movingId == 0 || IsWielded(_movingId) != _movingWasWielded;
|
||||
return _movingId == 0 && ServerIdle();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
|
|
@ -364,10 +364,15 @@ internal static class OffhandTests
|
|||
t = 500;
|
||||
Check.False(g.TryBeginSwap("weapon"), "the shield is still in hand");
|
||||
wielded[7] = false;
|
||||
Check.True(g.TryBeginSwap("weapon"), "the shield is off: the weapon goes at once (not at 3 s)");
|
||||
t = 700;
|
||||
Check.False(g.TryBeginSwap("off hand"), "under the 400 ms floor");
|
||||
t = 1000;
|
||||
t = 2999;
|
||||
Check.False(g.TryBeginSwap("weapon"), "a pack move: the full 3 s even once it reads done (the server's unwield motion, 13:58 wedge)");
|
||||
t = 3000;
|
||||
Check.True(g.TryBeginSwap("weapon"), "after 3 s");
|
||||
long claims = g.Claims;
|
||||
t = 3300;
|
||||
Check.False(g.TryBeginSwap("off hand"), "a use (the weapon): under the 400 ms floor");
|
||||
Check.Eq(g.Claims, claims, "a refused claim doesn't count");
|
||||
t = 3600;
|
||||
idle = false;
|
||||
Check.False(g.TryBeginSwap("off hand"), "the weapon's use is still unanswered");
|
||||
idle = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue