外观
legacy_commands API
模块说明
text
Waited-command bridge building block for a trusted legacy runtime domain.CommandOutcomeError
python
class CommandOutcomeError(Exception)CommandOutcomeError.__init__
python
def __init__(self, operation_id, state)另继承外部类型 Exception;其通用方法不在本 SDK 目录中重复展开。
CommandOutcomeError.operation_id
python
self.operation_id公开实例属性,在 __init__ 中设置。
CommandOutcomeError.state
python
self.state公开实例属性,在 __init__ 中设置。
CommandWaitTimeout
python
class CommandWaitTimeout(TimeoutError)CommandWaitTimeout.__init__
python
def __init__(self, operation_id, intent=None)另继承外部类型 TimeoutError;其通用方法不在本 SDK 目录中重复展开。
CommandWaitTimeout.operation_id
python
self.operation_id公开实例属性,在 __init__ 中设置。
CommandWaitTimeout.intent
python
self.intent公开实例属性,在 __init__ 中设置。
command_packet
python
def command_packet(completion, operation_id)SDK 说明:
text
Extract a copied full response, never invent origin or translate messages.CommandIntent
python
@dataclass(frozen=True)
class CommandIntentSDK 说明:
text
Prepared wire intent. Contains command data; never log its payload.
Construct with WaitedCommands.prepare. payload() returns an independent copy
for explicit replay through another authorized transport for the same owner.
This is not authority: the host still validates identity, grants and session.该类型另有以下内部字段,参与数据类声明但不建议直接读写;创建对象时优先使用专题中的工厂方法:
python
_json: str = field(repr=False)CommandIntent.payload
python
def payload(self)WaitedCommands
python
class WaitedCommandsSDK 说明:
text
Use from plugin threads with ThreadCalls, a fixed session and real factory.
This is not a complete launcher. No omit-response/WO emulation, auto-retry,
cancellation, event replay or game connection is provided. The caller keeps
the full immutable intent (key, deadline, command timeout, session and
arguments) for explicit reconciliation after ambiguous submission failures.WaitedCommands.__init__
python
def __init__(self, calls, session, output_factory)WaitedCommands.prepare
python
def prepare(
self,
cmd,
*,
idempotency_key,
deadline,
identity = 'player',
command_timeout = 30,
)SDK 说明:
text
Prepare without IO; retain this value before any submission.WaitedCommands.execute
python
def execute(
self,
cmd,
*,
idempotency_key,
deadline,
identity = 'player',
command_timeout = 30,
timeout = 30,
)WaitedCommands.execute_prepared
python
def execute_prepared(self, intent, *, timeout=30)SDK 说明:
text
Submit an explicitly retained intent once, then wait; never auto-retry.WaitedCommands.calls
python
self.calls公开实例属性,在 __init__ 中设置。
WaitedCommands.session
python
self.session公开实例属性,在 __init__ 中设置。
WaitedCommands.output_factory
python
self.output_factory公开实例属性,在 __init__ 中设置。
OmittedCommands
python
class OmittedCommandsSDK 说明:
text
Submit one legacy omit-response command; no retry or fabricated output.
Returned operation ID is admission evidence only. Keep the original payload
when reconciling an ambiguous submission; never invent a replacement key.OmittedCommands.__init__
python
def __init__(self, calls, session)OmittedCommands.submit
python
def submit(self, cmd, *, idempotency_key, deadline, identity='wo', timeout=10)OmittedCommands.calls
python
self.calls公开实例属性,在 __init__ 中设置。
OmittedCommands.session
python
self.session公开实例属性,在 __init__ 中设置。