Snapshot for release 2026.10.6.3 (internal f2255d0)

This commit is contained in:
Tom Bohar 2026-10-06 15:03:24 -04:00
commit bf702ebc67
3 changed files with 29 additions and 14 deletions

View file

@ -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 // 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. // got the wand into the hand in WieldResolveTimeoutMs, this session moves the weapon first.
private bool _directWandSwapFailed; 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 int _bowDequipPendingId;
private DateTime _bowDequipAt = DateTime.MinValue; private DateTime _bowDequipAt = DateTime.MinValue;
private int _bowDequipAttempts; private int _bowDequipAttempts;
@ -3900,6 +3903,11 @@ public class BuffManager : IDisposable
if ((now - _pendingWieldAt).TotalMilliseconds < WieldResolveTimeoutMs) if ((now - _pendingWieldAt).TotalMilliseconds < WieldResolveTimeoutMs)
return false; 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); int stillInHand = _directWandSwapFailed ? 0 : FindWieldedNonWandWeapon(wandId);
if (stillInHand != 0 && IsWieldedLive(stillInHand)) 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"); _host.UseFor((uint)wandId, "Buff", bowId != 0 && !_directWandSwapFailed ? "buffing: switch to the wand" : "buffing: wield the wand");
NoteStanceRequest(); NoteStanceRequest();
_pendingWieldClaim = _weaponSwapGate?.Claims ?? 0;
_pendingWieldId = wandId; _pendingWieldId = wandId;
_pendingWieldAt = now; _pendingWieldAt = now;
_lastCastAttempt = now; _lastCastAttempt = now;

View file

@ -25,7 +25,10 @@ public sealed class WeaponSwapGate
private long _lastSwapTickMs = long.MinValue / 4; private long _lastSwapTickMs = long.MinValue / 4;
private string _lastSwapBy = ""; private string _lastSwapBy = "";
private int _movingId; 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> /// <summary>
/// The longest one swap holds the next: a swap the server's answer can't be seen for (or /// 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; _lastSwapTickMs = now;
_lastSwapBy = requestedBy ?? ""; _lastSwapBy = requestedBy ?? "";
_movingId = 0; _movingId = 0;
_claims++;
return true; return true;
} }
} }
/// <summary> /// <summary>
/// The claimed swap moved <paramref name="itemId"/> into or out of a hand without a use (a /// 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 /// pack move or a slot wield): the next swap waits the full MinIntervalMs, as before.
/// once the item's wielded state is no longer <paramref name="wieldedNow"/>. /// 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> /// </summary>
public void NoteMove(int itemId, bool wieldedNow) public void NoteMove(int itemId, bool wieldedNow)
{ {
lock (_lock) lock (_lock) _movingId = itemId;
{
_movingId = itemId;
_movingWasWielded = wieldedNow;
}
} }
private bool LastSwapDone(long since) private bool LastSwapDone(long since)
@ -88,8 +90,7 @@ public sealed class WeaponSwapGate
if (since < FloorMs || ServerIdle == null || IsWielded == null) return false; if (since < FloorMs || ServerIdle == null || IsWielded == null) return false;
try try
{ {
if (!ServerIdle()) return false; return _movingId == 0 && ServerIdle();
return _movingId == 0 || IsWielded(_movingId) != _movingWasWielded;
} }
catch catch
{ {

View file

@ -364,10 +364,15 @@ internal static class OffhandTests
t = 500; t = 500;
Check.False(g.TryBeginSwap("weapon"), "the shield is still in hand"); Check.False(g.TryBeginSwap("weapon"), "the shield is still in hand");
wielded[7] = false; wielded[7] = false;
Check.True(g.TryBeginSwap("weapon"), "the shield is off: the weapon goes at once (not at 3 s)"); t = 2999;
t = 700; 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)");
Check.False(g.TryBeginSwap("off hand"), "under the 400 ms floor"); t = 3000;
t = 1000; 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; idle = false;
Check.False(g.TryBeginSwap("off hand"), "the weapon's use is still unanswered"); Check.False(g.TryBeginSwap("off hand"), "the weapon's use is still unanswered");
idle = true; idle = true;