fix(physics): TS-23 - plumb real PK/PKLite/Impenetrable mover flags
Campaign P Slice P3 item 3. The wire parse (CreateObject's PublicWeenieDesc._bitfield), the decode (EntityCollisionFlagsExt. FromPwdBitfield), the per-GUID storage (ClientObjectTable. PublicWeenieBitfield), and the exemption logic (CollisionExemption. ShouldSkip) all already existed and were already correct -- every mover-flags call site just fed a GUID-prefix IsPlayer heuristic instead of the real per-entity PK/PKLite/Impenetrable state (retail OBJECTINFO::init 0x0050cf30 state |= 0x80/0x800/0x1000). Port: - EntityCollisionFlagsExt.ToMoverState translates the decoded PWD bit-space into the ObjectInfoState bit-space FindObjCollisions actually reads -- two different numberings that must not be confused. Deliberately does not translate IsPlayer (every call site already derives that correctly from its own GUID heuristic per #184 Slice 2b). - EntityCollisionFlagsExt.ResolveMoverPvpState is the one shared ClientObjectTable-backed lookup (guid -> ObjectInfoState), replacing what would otherwise have been three separate inline copies across GameWindow/LivePresentationComposition/RemoteTeleportController. - Threaded as a new optional moverPvpState parameter through RuntimeRemotePhysicsUpdater.Tick/TickHidden and RuntimeOrdinaryPhysicsUpdater.TryBegin (default None preserves every pre-P3 caller unchanged), and as PlayerMovementController.OwnPvpFlags for the local player's own two resolve call sites. - TS-23 section 12b: PlayerWeenie.JumpStaminaCost's pk parameter now reads the real PlayerKillerStatus(0x86)/LastPkAttackTimestamp(0x91) pair against retail's 20-second recency window (pkStatus in {4, 0x40} && (timestamp + 20.0) >= now), replacing the P1 hardcoded false. RuntimeMovementSkillState/Snapshot and LiveSessionEventRouter.RecomputePvpStatus push both the PWD bitfield and the PlayerKillerStatus pair reactively, riding the SAME ClientObject event triggers RecomputeBurden already uses. - A conformance test caught a genuine precision bug in the first PK-timer clock choice: DateTimeOffset.UtcNow's Unix-epoch seconds (~1.7 billion) loses ~128 seconds of precision in a 32-bit float, silently swallowing the entire 20-second window. Switched to Environment.TickCount64 (small, monotonic magnitude) -- also the more retail-plausible basis, since LastPkAttackTimestamp is itself a wire PropertyFloat and retail's Timer::cur_time is almost certainly a process/session-relative counter for the same precision reason, not an absolute epoch. Non-PK invariant (the acceptance criterion): an entity with no ClientObjectTable row, or a row whose PublicWeenieBitfield is null or 0, resolves to ObjectInfoState.None -- a no-op OR into moverFlags, bit-identical to every pre-P3 caller's hardcoded value. A dedicated test drives two real ClientObjectTable rows through CollisionExemption.ShouldSkip and confirms PK-vs-PK collides while PK-vs-non-PK and non-PK-vs-non-PK both stay exempt (walk through). Register: TS-23 retired (both the collision-flags and PK-timer halves); the stale "M2 combat must land TS-23" phase-gate note removed. dotnet build + dotnet test (Core.Tests 4008/2 skip, Runtime.Tests 425/0, App.Tests 3968/3 skip, complete solution build) all green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
8b5425498c
commit
bb7b899bfe
17 changed files with 702 additions and 53 deletions
|
|
@ -163,6 +163,21 @@ public sealed class PlayerMovementController
|
|||
/// </summary>
|
||||
public float StepDownHeight { get; set; } = 0.4f;
|
||||
|
||||
/// <summary>
|
||||
/// TS-23 (Campaign P Slice P3, 2026-07-30): the local player's own
|
||||
/// PK/PKLite/Impenetrable <see cref="ObjectInfoState"/> bits, decoded
|
||||
/// from <c>PublicWeenieDesc._bitfield</c> (retail <c>OBJECTINFO::init</c>
|
||||
/// 0x0050cf30 `state |= w->vtable->IsPK()/IsPKLite()/IsImpenetrable()
|
||||
/// ? 0x800/0x1000/0x80`). Set at world-entry and refreshed reactively
|
||||
/// whenever the player's own <c>ClientObject.PublicWeenieBitfield</c>
|
||||
/// changes (same trigger set as <see cref="StepUpHeight"/>'s
|
||||
/// server-skill pushes). Default <see cref="ObjectInfoState.None"/>
|
||||
/// (no PK/PKLite/Impenetrable) is bit-identical to every pre-P3 caller's
|
||||
/// hardcoded <c>IsPlayer | EdgeSlide</c> — the non-PK invariant this
|
||||
/// port must not break.
|
||||
/// </summary>
|
||||
public ObjectInfoState OwnPvpFlags { get; set; } = ObjectInfoState.None;
|
||||
|
||||
/// <summary>
|
||||
/// TS-46 (2026-07-30): the player's own Setup ≤2-sphere list (dat
|
||||
/// <c>CSphere</c> Origin+Radius), verbatim per retail
|
||||
|
|
@ -930,6 +945,22 @@ public sealed class PlayerMovementController
|
|||
_weenie.SetStamina(currentStamina < 0 ? null : (uint)currentStamina);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TS-23 §12b (Campaign P Slice P3, 2026-07-30): pushes the raw
|
||||
/// <c>PlayerKillerStatus</c>/<c>LastPkAttackTimestamp</c> pair into
|
||||
/// <see cref="PlayerWeenie.JumpStaminaCost"/>'s PK-timer bump. A
|
||||
/// negative <paramref name="playerKillerStatus"/> restores "never
|
||||
/// pushed" (matches <see cref="SetCharacterStamina"/>'s own sentinel
|
||||
/// convention); <paramref name="lastPkAttackTimestamp"/> is <c>null</c>
|
||||
/// when the property is absent.
|
||||
/// </summary>
|
||||
public void SetCharacterPkStatus(int playerKillerStatus, float? lastPkAttackTimestamp)
|
||||
{
|
||||
_weenie.SetPlayerKillerStatus(
|
||||
playerKillerStatus < 0 ? null : playerKillerStatus,
|
||||
lastPkAttackTimestamp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// R3-W2 (r3-port-plan.md §4): the player's <see cref="MotionInterpreter"/>
|
||||
/// — GameWindow binds the player sequencer's MotionDone seam to it so the
|
||||
|
|
@ -1418,7 +1449,10 @@ public sealed class PlayerMovementController
|
|||
stepDownHeight: StepDownHeight,
|
||||
isOnGround: previousOnWalkable,
|
||||
body: _body,
|
||||
moverFlags: ObjectInfoState.IsPlayer | ObjectInfoState.EdgeSlide,
|
||||
// TS-23: OwnPvpFlags is None for every non-PK character
|
||||
// (the default), so this OR is a no-op for the common
|
||||
// case and bit-identical to the pre-P3 hardcoded value.
|
||||
moverFlags: ObjectInfoState.IsPlayer | ObjectInfoState.EdgeSlide | OwnPvpFlags,
|
||||
movingEntityId: LocalEntityId,
|
||||
// TS-46: the player's own Setup sphere list, scaled by
|
||||
// ObjectScale. Empty falls back to the 0.48/1.835
|
||||
|
|
@ -1859,12 +1893,15 @@ public sealed class PlayerMovementController
|
|||
// under the same flag profile as retail player movement.
|
||||
//
|
||||
// Commit C 2026-04-29 — local player is always IsPlayer.
|
||||
// The PK/PKLite/Impenetrable bits come from PlayerDescription's
|
||||
// PlayerKillerStatus property; not yet parsed (non-PK pair → walks
|
||||
// through other non-PK players, which is retail's default for
|
||||
// ACE's character creation defaults too).
|
||||
// TS-23 (2026-07-30): OwnPvpFlags carries the real
|
||||
// PK/PKLite/Impenetrable bits, decoded from the player's own
|
||||
// PublicWeenieDesc._bitfield (default None — a no-op OR for
|
||||
// every non-PK character, bit-identical to the pre-P3 value;
|
||||
// non-PK pair still walks through other non-PK players,
|
||||
// retail's default for ACE's character creation defaults).
|
||||
moverFlags: AcDream.Core.Physics.ObjectInfoState.IsPlayer
|
||||
| AcDream.Core.Physics.ObjectInfoState.EdgeSlide,
|
||||
| AcDream.Core.Physics.ObjectInfoState.EdgeSlide
|
||||
| OwnPvpFlags,
|
||||
// Fix #42: skip self in FindObjCollisions. Wired by GameWindow
|
||||
// when the local player entity spawns (or stays 0 in tests, in
|
||||
// which case there's no registered ShadowEntry to collide with
|
||||
|
|
|
|||
|
|
@ -138,6 +138,9 @@ public sealed class RuntimeCharacterState : IDisposable
|
|||
&& MovementSkills.JumpSkill == -1
|
||||
&& MovementSkills.Burden == 0f
|
||||
&& MovementSkills.CurrentStamina == -1
|
||||
&& MovementSkills.OwnPwdBitfield == 0u
|
||||
&& MovementSkills.PlayerKillerStatus == -1
|
||||
&& MovementSkills.LastPkAttackTimestamp is null
|
||||
&& _runSkillBase == -1
|
||||
&& _jumpSkillBase == -1);
|
||||
}
|
||||
|
|
@ -552,19 +555,32 @@ public readonly record struct RuntimeMovementSkillSnapshot(
|
|||
// ratio (0.0 unencumbered) and current stamina (-1 = unknown/don't-gate,
|
||||
// matching RunSkill/JumpSkill's own sentinel convention).
|
||||
float Burden = 0f,
|
||||
int CurrentStamina = -1)
|
||||
int CurrentStamina = -1,
|
||||
// TS-23 (Campaign P Slice P3, 2026-07-30): the local player's own
|
||||
// PublicWeenieDesc._bitfield (0 = never pushed / no PK-relevant bits —
|
||||
// a no-op OR, matching every pre-P3 caller) and the raw
|
||||
// PlayerKillerStatus/LastPkAttackTimestamp pair §12b's PK-timer
|
||||
// jump-cost bump reads (-1 / null = never pushed).
|
||||
uint OwnPwdBitfield = 0u,
|
||||
int PlayerKillerStatus = -1,
|
||||
float? LastPkAttackTimestamp = null)
|
||||
{
|
||||
public bool IsComplete => RunSkill >= 0 && JumpSkill >= 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server-authoritative run/jump/burden/stamina values retained
|
||||
/// Server-authoritative run/jump/burden/stamina/PK-status values retained
|
||||
/// independently of any graphical movement controller. App applies this
|
||||
/// borrowed state whenever its presentation/physics controller exists or is
|
||||
/// rebuilt. Campaign P Slice P1 (2026-07-30) extended this beyond run/jump
|
||||
/// skill to the full stat-coupled-movement input set (burden, current
|
||||
/// stamina) — see the pseudocode doc §9. RunSkill/JumpSkill arrive here
|
||||
/// ALREADY vitae/enchantment-adjusted by
|
||||
/// stamina) — see the pseudocode doc §9. Campaign P Slice P3 (2026-07-30)
|
||||
/// further added the player's own PWD bitfield (PK/PKLite/Impenetrable
|
||||
/// collision-exemption bits) and the PlayerKillerStatus/
|
||||
/// LastPkAttackTimestamp pair (the PK-timer jump-cost bump) — the SAME
|
||||
/// reactive push seam, since both ride the player's own ClientObject
|
||||
/// property-update stream. RunSkill/JumpSkill arrive here ALREADY
|
||||
/// vitae/enchantment-adjusted by
|
||||
/// <see cref="RuntimeCharacterState.RecomputeMovementSkills"/>.
|
||||
/// </summary>
|
||||
public sealed class RuntimeMovementSkillState
|
||||
|
|
@ -573,16 +589,34 @@ public sealed class RuntimeMovementSkillState
|
|||
private int _jumpSkill = -1;
|
||||
private float _burden;
|
||||
private int _currentStamina = -1;
|
||||
private uint _ownPwdBitfield;
|
||||
private int _playerKillerStatus = -1;
|
||||
private float _lastPkAttackTimestamp;
|
||||
private bool _hasLastPkAttackTimestamp;
|
||||
private long _revision;
|
||||
|
||||
public int RunSkill => Volatile.Read(ref _runSkill);
|
||||
public int JumpSkill => Volatile.Read(ref _jumpSkill);
|
||||
public float Burden => Volatile.Read(ref _burden);
|
||||
public int CurrentStamina => Volatile.Read(ref _currentStamina);
|
||||
public uint OwnPwdBitfield => Volatile.Read(ref _ownPwdBitfield);
|
||||
public int PlayerKillerStatus => Volatile.Read(ref _playerKillerStatus);
|
||||
public float? LastPkAttackTimestamp =>
|
||||
Volatile.Read(ref _hasLastPkAttackTimestamp)
|
||||
? Volatile.Read(ref _lastPkAttackTimestamp)
|
||||
: null;
|
||||
public bool IsComplete => _runSkill >= 0 && _jumpSkill >= 0;
|
||||
public long Revision => Interlocked.Read(ref _revision);
|
||||
public RuntimeMovementSkillSnapshot Snapshot =>
|
||||
new(_runSkill, _jumpSkill, Revision, _burden, _currentStamina);
|
||||
new(
|
||||
_runSkill,
|
||||
_jumpSkill,
|
||||
Revision,
|
||||
_burden,
|
||||
_currentStamina,
|
||||
OwnPwdBitfield,
|
||||
PlayerKillerStatus,
|
||||
LastPkAttackTimestamp);
|
||||
|
||||
public void Update(int runSkill, int jumpSkill)
|
||||
{
|
||||
|
|
@ -626,12 +660,62 @@ public sealed class RuntimeMovementSkillState
|
|||
Interlocked.Increment(ref _revision);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TS-23 (Campaign P Slice P3, 2026-07-30): pushes the local player's own
|
||||
/// raw <c>PublicWeenieDesc._bitfield</c> — the PWD wire bit-space
|
||||
/// <see cref="AcDream.Core.Physics.EntityCollisionFlagsExt.FromPwdBitfield"/>
|
||||
/// decodes. Fires on the SAME <c>ClientObject</c> add/update events
|
||||
/// <see cref="UpdateBurden"/> already reacts to (the player's own
|
||||
/// PublicWeenieBitfield lives on the same row).
|
||||
/// </summary>
|
||||
public void UpdateOwnPwdBitfield(uint bitfield)
|
||||
{
|
||||
if (OwnPwdBitfield == bitfield) return;
|
||||
Volatile.Write(ref _ownPwdBitfield, bitfield);
|
||||
Interlocked.Increment(ref _revision);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TS-23 §12b: pushes the raw <c>PlayerKillerStatus</c>
|
||||
/// (<c>PropertyInt</c> 0x86) / <c>LastPkAttackTimestamp</c>
|
||||
/// (<c>PropertyFloat</c> 0x91) pair feeding
|
||||
/// <c>CACQualities::JumpStaminaCost</c>'s 20-second PK-timer bump. A
|
||||
/// negative <paramref name="playerKillerStatus"/> restores "never
|
||||
/// pushed" (matches <see cref="UpdateStamina"/>'s own sentinel
|
||||
/// convention); <paramref name="lastPkAttackTimestamp"/> is <c>null</c>
|
||||
/// when the property is absent.
|
||||
/// </summary>
|
||||
public void UpdatePlayerKillerStatus(int playerKillerStatus, float? lastPkAttackTimestamp)
|
||||
{
|
||||
bool changed = false;
|
||||
if (PlayerKillerStatus != playerKillerStatus)
|
||||
{
|
||||
Volatile.Write(ref _playerKillerStatus, playerKillerStatus);
|
||||
changed = true;
|
||||
}
|
||||
bool hasTimestamp = lastPkAttackTimestamp.HasValue;
|
||||
float timestamp = lastPkAttackTimestamp ?? 0f;
|
||||
if (Volatile.Read(ref _hasLastPkAttackTimestamp) != hasTimestamp
|
||||
|| (hasTimestamp && Volatile.Read(ref _lastPkAttackTimestamp) != timestamp))
|
||||
{
|
||||
Volatile.Write(ref _lastPkAttackTimestamp, timestamp);
|
||||
Volatile.Write(ref _hasLastPkAttackTimestamp, hasTimestamp);
|
||||
changed = true;
|
||||
}
|
||||
if (changed)
|
||||
Interlocked.Increment(ref _revision);
|
||||
}
|
||||
|
||||
public void ResetSession()
|
||||
{
|
||||
Volatile.Write(ref _runSkill, -1);
|
||||
Volatile.Write(ref _jumpSkill, -1);
|
||||
Volatile.Write(ref _burden, 0f);
|
||||
Volatile.Write(ref _currentStamina, -1);
|
||||
Volatile.Write(ref _ownPwdBitfield, 0u);
|
||||
Volatile.Write(ref _playerKillerStatus, -1);
|
||||
Volatile.Write(ref _lastPkAttackTimestamp, 0f);
|
||||
Volatile.Write(ref _hasLastPkAttackTimestamp, false);
|
||||
Interlocked.Increment(ref _revision);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
using AcDream.Core.Physics;
|
||||
|
||||
namespace AcDream.Runtime.Gameplay;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -23,6 +25,17 @@ public static class RuntimeMovementSkillProjection
|
|||
// seam run/jump skill already used — see the pseudocode doc §9.
|
||||
controller.SetCharacterBurden(snapshot.Burden);
|
||||
controller.SetCharacterStamina(snapshot.CurrentStamina);
|
||||
// TS-23 (Campaign P Slice P3, 2026-07-30): the player's own
|
||||
// PK/PKLite/Impenetrable collision-exemption bits and the
|
||||
// PlayerKillerStatus/LastPkAttackTimestamp pair the jump-cost
|
||||
// PK-timer bump reads — see EntityCollisionFlagsExt.ToMoverState
|
||||
// and PlayerWeenie.JumpStaminaCost.
|
||||
controller.OwnPvpFlags =
|
||||
EntityCollisionFlagsExt.FromPwdBitfield(snapshot.OwnPwdBitfield)
|
||||
.ToMoverState();
|
||||
controller.SetCharacterPkStatus(
|
||||
snapshot.PlayerKillerStatus,
|
||||
snapshot.LastPkAttackTimestamp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,10 @@ internal sealed class RuntimeOrdinaryPhysicsUpdater
|
|||
sphereList = default,
|
||||
float sphereScale = 1f,
|
||||
float stepUpHeight = 0.4f,
|
||||
float stepDownHeight = 0.4f)
|
||||
float stepDownHeight = 0.4f,
|
||||
// TS-23 (2026-07-30): see RuntimeRemotePhysicsUpdater.Tick's
|
||||
// identical parameter.
|
||||
ObjectInfoState moverPvpState = ObjectInfoState.None)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
ArgumentNullException.ThrowIfNull(rootFrame);
|
||||
|
|
@ -142,9 +145,12 @@ internal sealed class RuntimeOrdinaryPhysicsUpdater
|
|||
stepDownHeight: stepDownHeight, // TS-46: Setup-derived, was a 0.4f literal
|
||||
isOnGround: previousOnWalkable,
|
||||
body: body,
|
||||
moverFlags: IsPlayerGuid(record.ServerGuid)
|
||||
// TS-23: moverPvpState is a no-op OR (None) for every
|
||||
// non-PK ordinary mover.
|
||||
moverFlags: (IsPlayerGuid(record.ServerGuid)
|
||||
? ObjectInfoState.IsPlayer | ObjectInfoState.EdgeSlide
|
||||
: ObjectInfoState.EdgeSlide,
|
||||
: ObjectInfoState.EdgeSlide)
|
||||
| moverPvpState,
|
||||
movingEntityId: movingEntityId,
|
||||
// TS-46: the Setup's own sphere list, scaled by ObjScale.
|
||||
// Empty falls back to the radius/height reconstruction above.
|
||||
|
|
|
|||
|
|
@ -83,7 +83,14 @@ internal sealed class RuntimeRemotePhysicsUpdater
|
|||
sphereList = default,
|
||||
float sphereScale = 1f,
|
||||
float stepUpHeight = 0.4f,
|
||||
float stepDownHeight = 0.4f)
|
||||
float stepDownHeight = 0.4f,
|
||||
// TS-23 (2026-07-30): the remote's own PK/PKLite/Impenetrable
|
||||
// ObjectInfoState bits (LiveEntityMotionRuntimeController's
|
||||
// ClientObjectTable-backed lookup, translated via
|
||||
// EntityCollisionFlagsExt.ToMoverState). Default None is a no-op OR
|
||||
// for every non-PK remote — bit-identical to the pre-P3 value.
|
||||
AcDream.Core.Physics.ObjectInfoState moverPvpState =
|
||||
AcDream.Core.Physics.ObjectInfoState.None)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
ArgumentNullException.ThrowIfNull(rm);
|
||||
|
|
@ -382,15 +389,17 @@ internal sealed class RuntimeRemotePhysicsUpdater
|
|||
// non-PK player pair). Without IsPlayer the mover would de-overlap
|
||||
// two players — MORE solid than retail (you can stand inside another
|
||||
// non-PK player in AC). Players still COLLIDE with monsters (target
|
||||
// not IsPlayer → no exemption) + terrain + walls. PK/PKLite/
|
||||
// Impenetrable are NOT plumbed onto the remote mover yet, so a PK
|
||||
// pair walks through where retail collides — the SAME M1.5 gap the
|
||||
// local player carries (see TS-23; PlayerDescription PK status
|
||||
// unparsed).
|
||||
moverFlags: IsPlayerGuid(serverGuid)
|
||||
// not IsPlayer → no exemption) + terrain + walls. TS-23
|
||||
// (2026-07-30): moverPvpState carries the remote's real
|
||||
// PK/PKLite/Impenetrable bits (default None — a no-op OR
|
||||
// for every non-PK remote, bit-identical to the pre-P3
|
||||
// value); a PK-vs-PK pair now collides exactly like
|
||||
// retail instead of always walking through.
|
||||
moverFlags: (IsPlayerGuid(serverGuid)
|
||||
? AcDream.Core.Physics.ObjectInfoState.IsPlayer
|
||||
| AcDream.Core.Physics.ObjectInfoState.EdgeSlide
|
||||
: AcDream.Core.Physics.ObjectInfoState.EdgeSlide,
|
||||
: AcDream.Core.Physics.ObjectInfoState.EdgeSlide)
|
||||
| moverPvpState,
|
||||
// Fix #42 (2026-05-05): skip the moving remote's
|
||||
// own ShadowEntry. _animatedEntities is keyed by
|
||||
// entity.Id so kv.Key matches the EntityId the
|
||||
|
|
@ -629,12 +638,14 @@ internal sealed class RuntimeRemotePhysicsUpdater
|
|||
System.Func<RuntimeRemotePhysicsSnapshot, bool>?
|
||||
acknowledgeProjection = null,
|
||||
System.Func<bool>? externalOwnerValid = null,
|
||||
// TS-46 (2026-07-30): see the visible Tick's identical parameters.
|
||||
// TS-46/TS-23 (2026-07-30): see the visible Tick's identical parameters.
|
||||
System.Collections.Immutable.ImmutableArray<AcDream.Core.Physics.FlatCollisionSphere>
|
||||
sphereList = default,
|
||||
float sphereScale = 1f,
|
||||
float stepUpHeight = 0.4f,
|
||||
float stepDownHeight = 0.4f)
|
||||
float stepDownHeight = 0.4f,
|
||||
AcDream.Core.Physics.ObjectInfoState moverPvpState =
|
||||
AcDream.Core.Physics.ObjectInfoState.None)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(record);
|
||||
ArgumentNullException.ThrowIfNull(rm);
|
||||
|
|
@ -709,10 +720,13 @@ internal sealed class RuntimeRemotePhysicsUpdater
|
|||
stepDownHeight: stepDownHeight, // TS-46: Setup-derived, was a 0.4f literal
|
||||
isOnGround: previousOnWalkable,
|
||||
body: rm.Body,
|
||||
moverFlags: IsPlayerGuid(record.ServerGuid)
|
||||
// TS-23: moverPvpState is a no-op OR (None) for every
|
||||
// non-PK remote.
|
||||
moverFlags: (IsPlayerGuid(record.ServerGuid)
|
||||
? AcDream.Core.Physics.ObjectInfoState.IsPlayer
|
||||
| AcDream.Core.Physics.ObjectInfoState.EdgeSlide
|
||||
: AcDream.Core.Physics.ObjectInfoState.EdgeSlide,
|
||||
: AcDream.Core.Physics.ObjectInfoState.EdgeSlide)
|
||||
| moverPvpState,
|
||||
movingEntityId: localEntityId,
|
||||
// TS-46: the Setup's own sphere list, scaled by ObjScale.
|
||||
// Empty falls back to the radius/height reconstruction above.
|
||||
|
|
|
|||
|
|
@ -193,31 +193,34 @@ public sealed class LiveSessionEventRouter : ILiveSessionEventRouting
|
|||
// the SAME event set IndicatorBarController.UpdateBurden already
|
||||
// reacts to (Strength + augmentation property 0xE6 +
|
||||
// EncumbranceVal property 5, falling back to SumCarriedBurden).
|
||||
// See the pseudocode doc §9.
|
||||
// See the pseudocode doc §9. Campaign P Slice P3 (2026-07-30)
|
||||
// rides the SAME triggers for the player's own PWD bitfield
|
||||
// (PK/PKLite/Impenetrable) and PlayerKillerStatus/
|
||||
// LastPkAttackTimestamp — all live on the SAME ClientObject row.
|
||||
SubscribeToRecompute<ClientObject>(
|
||||
h => inventory.Objects.ObjectAdded += h,
|
||||
h => inventory.Objects.ObjectAdded -= h,
|
||||
() => RecomputeBurden(inventory, character));
|
||||
() => { RecomputeBurden(inventory, character); RecomputePvpStatus(inventory, character); });
|
||||
SubscribeToRecompute<ClientObject>(
|
||||
h => inventory.Objects.ObjectUpdated += h,
|
||||
h => inventory.Objects.ObjectUpdated -= h,
|
||||
() => RecomputeBurden(inventory, character));
|
||||
() => { RecomputeBurden(inventory, character); RecomputePvpStatus(inventory, character); });
|
||||
SubscribeToRecompute<ClientObject>(
|
||||
h => inventory.Objects.ObjectRemoved += h,
|
||||
h => inventory.Objects.ObjectRemoved -= h,
|
||||
() => RecomputeBurden(inventory, character));
|
||||
() => { RecomputeBurden(inventory, character); RecomputePvpStatus(inventory, character); });
|
||||
SubscribeToRecompute<ClientObjectMove>(
|
||||
h => inventory.Objects.ObjectMoved += h,
|
||||
h => inventory.Objects.ObjectMoved -= h,
|
||||
() => RecomputeBurden(inventory, character));
|
||||
() => { RecomputeBurden(inventory, character); RecomputePvpStatus(inventory, character); });
|
||||
SubscribeToRecompute<uint>(
|
||||
h => inventory.Objects.ContainerContentsReplaced += h,
|
||||
h => inventory.Objects.ContainerContentsReplaced -= h,
|
||||
() => RecomputeBurden(inventory, character));
|
||||
() => { RecomputeBurden(inventory, character); RecomputePvpStatus(inventory, character); });
|
||||
SubscribeParameterless(
|
||||
h => inventory.Objects.Cleared += h,
|
||||
h => inventory.Objects.Cleared -= h,
|
||||
() => RecomputeBurden(inventory, character));
|
||||
() => { RecomputeBurden(inventory, character); RecomputePvpStatus(inventory, character); });
|
||||
Subscribe<LocalPlayerState.AttributeKind>(
|
||||
h => character.Character.LocalPlayer.AttributeChanged += h,
|
||||
h => character.Character.LocalPlayer.AttributeChanged -= h,
|
||||
|
|
@ -381,6 +384,40 @@ public sealed class LiveSessionEventRouter : ILiveSessionEventRouting
|
|||
character.OnMovementStatsUpdated?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TS-23 (Campaign P Slice P3, 2026-07-30): pushes the local player's
|
||||
/// own <c>PublicWeenieDesc._bitfield</c> (PK/PKLite/Impenetrable
|
||||
/// collision-exemption bits, already parsed at CreateObject time — see
|
||||
/// <c>CreateObject.cs</c>'s <c>objectDescriptionFlags</c> read) and the
|
||||
/// raw <c>PlayerKillerStatus</c>(0x86)/<c>LastPkAttackTimestamp</c>(0x91)
|
||||
/// pair (retail <c>CACQualities::JumpStaminaCost</c>'s PK-timer bump)
|
||||
/// into <see cref="RuntimeMovementSkillState"/>. Rides the SAME
|
||||
/// ClientObject add/update/move/clear events <see cref="RecomputeBurden"/>
|
||||
/// already reacts to — both live on the player's own row.
|
||||
/// </summary>
|
||||
private static void RecomputePvpStatus(
|
||||
LiveInventorySessionBindings inventory,
|
||||
LiveCharacterSessionBindings character)
|
||||
{
|
||||
uint player = inventory.PlayerGuid();
|
||||
ClientObject? playerObject = inventory.Objects.Get(player);
|
||||
uint bitfield = playerObject?.PublicWeenieBitfield ?? 0u;
|
||||
int pkStatus = playerObject?.Properties.Ints.TryGetValue(
|
||||
(uint)PropertyInt.PlayerKillerStatus, out int wirePkStatus) == true
|
||||
? wirePkStatus
|
||||
: -1;
|
||||
float? lastPkAttackTimestamp =
|
||||
playerObject?.Properties.Floats.TryGetValue(
|
||||
(uint)PropertyFloat.LastPkAttackTimestamp, out double wireTimestamp) == true
|
||||
? (float)wireTimestamp
|
||||
: null;
|
||||
character.Character.MovementSkills.UpdateOwnPwdBitfield(bitfield);
|
||||
character.Character.MovementSkills.UpdatePlayerKillerStatus(
|
||||
pkStatus,
|
||||
lastPkAttackTimestamp);
|
||||
character.OnMovementStatsUpdated?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Campaign P Slice P1 (2026-07-30): pushes current-stamina vital
|
||||
/// changes into <see cref="RuntimeMovementSkillState"/> — feeds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue