外观
combat_actions API
模块说明
text
Experimental single-controller melee sequence; no unified Host clock claim.MeleeSession
python
class MeleeSessionSDK 说明:
text
One MouseOver → attack → SwingArm → neutral plan, with no replay/cleanup.
prepare requires explicit experimental_single_controller=True. Every producer
must use the same process-local ActionControl and other writers must be absent.
guard is a caller-owned fresh observation adapter, not an atomic writer fence.
It must fail on stream gaps/reconnect/identity ambiguity and continuously drain
the independent observation stream, including while operations.wait is pending.
Success means dispatched receipts, never confirmed damage. Explicit action=
"swing_only" sends SwingArm → neutral, with no MouseOver or attack transaction.
No target binding is used in swing_only; interaction geometry must be
None and exactly two keys are required. The same guards and journal apply.MeleeSession.labels
python
labels = ('mouse_over', 'attack', 'swing', 'neutral')MeleeSession.binding_fields
python
binding_fields = ('actor_uuid', 'actor_runtime_id', 'target_unique_id', 'target_runtime_id', 'dimension', 'inventory_connection_id', 'observer_epoch')MeleeSession.fields_for
python
@classmethod
def fields_for(cls, action)MeleeSession.prepare
python
@classmethod
def prepare(
cls,
actions,
inventory,
slot,
*,
binding,
mouse_position,
attack_position,
clicked_position,
swing_data,
neutral_input,
idempotency_keys,
deadline,
experimental_single_controller = False,
action = 'attack',
)MeleeSession.record
python
def record(self)SDK 说明:
text
Persist this entire record; sensitive identity/intent data omitted in repr.MeleeSession.dispatch
python
async def dispatch(
self,
*,
control,
guard,
journal,
timeout = 10,
max_sample_age = 0.5,
poll_interval = 0.05,
)SDK 说明:
text
Persist plan, admission IDs, every receipt/error; no continuation on fault.
journal must durably replace/bind a single business record before returning.
On crash, reload retained keys through operations.get; never reconstruct and
resend the session. A persistence exception seals this object and may leave
only the earlier durable record; in-memory attempts still retain IDs.MeleeSession.action
python
self.action公开实例属性,在 prepare 中设置。
MeleeSession.binding
python
self.binding公开实例属性,在 prepare 中设置。
MeleeSession.reference
python
self.reference公开实例属性,在 prepare 中设置。
MeleeSession.tick
python
self.tick公开实例属性,在 prepare 中设置。
MeleeSession.attempts
python
self.attempts公开实例属性,在 prepare 中设置。
MeleeSession.started
python
self.started公开实例属性,在 prepare、dispatch 中设置。
MeleeSession.state
python
self.state公开实例属性,在 prepare、dispatch 中设置。