跳转到正文

scoreboard API ​

完整接口目录 · 命令与计分板用法 · 工具包下载

模块说明 ​

text
Exact-holder scoreboard intents using the native durable Operations client.

Scoreboard ​

python
class Scoreboard

SDK 说明:

text
Prepare without IO; retain the intent and submit/wait with Operations.

Each operation requires its own permission. Selectors, arbitrary commands
and automatic retries are intentionally absent. Results
describe this command's acknowledgement, not a permanently current score.

Scoreboard.__init__ ​

python
def __init__(self, operations)

Scoreboard.prepare_get ​

python
def prepare_get(self, holder, objective, *, idempotency_key, deadline)

SDK 说明:

text
Result: holder, objective, found, and value only when found.

Scoreboard.prepare_set ​

python
def prepare_set(self, holder, objective, value, *, idempotency_key, deadline)

Scoreboard.prepare_add ​

python
def prepare_add(self, holder, objective, delta, *, idempotency_key, deadline)

SDK 说明:

text
Negative delta removes points; zero is a valid server add operation.

Scoreboard.prepare_reset ​

python
def prepare_reset(self, holder, objective, *, idempotency_key, deadline)

SDK 说明:

text
Remove one holder's score from the required objective only.

Scoreboard.prepare_operation ​

python
def prepare_operation(
    self,
    holder,
    objective,
    operator,
    source_holder,
    source_objective,
    *,
    idempotency_key,
    deadline,
)

SDK 说明:

text
Apply one operation; >< swaps both exact targets' scores.

Scoreboard.prepare_objective_add ​

python
def prepare_objective_add(
    self,
    objective,
    *,
    display_name = None,
    idempotency_key,
    deadline,
)

SDK 说明:

text
Create a dummy objective with an optional literal display name.

Scoreboard.prepare_objective_remove ​

python
def prepare_objective_remove(self, objective, *, idempotency_key, deadline)

Scoreboard.prepare_objective_list ​

python
def prepare_objective_list(self, *, idempotency_key, deadline)

SDK 说明:

text
Result: objectives with name, display_name and criteria.

Scoreboard.prepare_objective_setdisplay ​

python
def prepare_objective_setdisplay(
    self,
    slot,
    objective = None,
    *,
    sort_order = None,
    idempotency_key,
    deadline,
)

SDK 说明:

text
Set list/sidebar/belowname; omit objective to clear that display slot.

Scoreboard.operations ​

python
self.operations

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

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