跳转到正文

player_abilities API ​

完整接口目录 · 玩家查询用法 · 工具包下载

模块说明 ​

text
Native inbound ability evidence and explicit, unretried permission requests.

PlayerAbilityReference ​

python
class PlayerAbilityReference(TypedDict)

字段(包含继承字段):

PlayerAbilityReference.connection_id ​

python
connection_id: str

必填;声明于 player_abilities.PlayerAbilityReference。

PlayerAbilityReference.unique_id ​

python
unique_id: str

必填;声明于 player_abilities.PlayerAbilityReference。

PlayerAbilityReference.uuid ​

python
uuid: str

必填;声明于 player_abilities.PlayerAbilityReference。

PlayerAbilityReference.revision ​

python
revision: int

必填;声明于 player_abilities.PlayerAbilityReference。

PlayerAbilities ​

python
class PlayerAbilities

SDK 说明:

text
Prepare only, with caller-owned idempotency keys and fixed deadlines.

Observation reads cached inbound UpdateAbilities. Request does not update
that cache or wait for a fabricated acknowledgement. Execute the returned
intent through Operations; retain unknown outcomes and never retry them
automatically. A later observation is independent evidence.

PlayerAbilities.__init__ ​

python
def __init__(self, operations: Operations)

PlayerAbilities.observe ​

python
def observe(
    self,
    unique_id: str,
    *,
    idempotency_key: str,
    deadline: str,
    connection_id: str = '',
    max_age_ms: int = 500,
) -> OperationIntent

SDK 说明:

text
Read one unique ID, optionally pinned to a connection; no refresh IO.

PlayerAbilities.request ​

python
def request(
    self,
    ref: PlayerAbilityReference,
    *,
    permission_level: int,
    requested_permissions: int,
    idempotency_key: str,
    deadline: str,
) -> OperationIntent

SDK 说明:

text
Request level 0..3 and the supported low eight permission bits.

The Host rechecks grants and current target revision before dispatch.
Only a real inbound observation supplies ref; player names are not refs.
Successful dispatch does not prove that permissions changed.

PlayerAbilities.operations ​

python
self.operations

公开实例属性,在 __init__ 中设置。

Neomega · 使用、开发与参考文档