跳转到正文

player_state API ​

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

模块说明 ​

text
Single-owner projection of the core's observed player maps.

No callbacks, threads or invented join events. A fault clears state permanently;
create a new instance from a new atomic snapshot. Returned snapshots are copies.

PlayerState ​

python
class PlayerState

SDK 说明:

text
Bounded current state, not history or a complete-roster assertion.

At most 4096 entries in each of three maps and 8 MiB charged payload. Python
object overhead, incoming document, copy-on-update and caller snapshots are
additional; at most old plus replacement map payload coexist during apply.
Call from one owner; this class is not a concurrent synchronization primitive.

PlayerState.__init__ ​

python
def __init__(self, snapshot)

PlayerState.epoch ​

python
@property
def epoch(self)

PlayerState.revision ​

python
@property
def revision(self)

PlayerState.apply ​

python
def apply(self, observation, *, epoch)

SDK 说明:

text
Apply exactly the next revision, atomically for the single owner.

PlayerState.snapshot ​

python
def snapshot(self)

SDK 说明:

text
Return an independent current snapshot; does not emit player events.

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