fix broadcasting added points
This commit is contained in:
parent
9e7000054b
commit
2f87ea925e
2 changed files with 4 additions and 4 deletions
|
|
@ -44,18 +44,18 @@
|
||||||
<span class="name">player name</span>
|
<span class="name">player name</span>
|
||||||
<div class="admin-only">
|
<div class="admin-only">
|
||||||
(<span class="points">points</span> pts) (<span class="tokens">tokens</span> tks)
|
(<span class="points">points</span> pts) (<span class="tokens">tokens</span> tks)
|
||||||
<button data-eval="send('control', {target: client.id, action: 'monitor'})">
|
<button data-eval="conn.send('control', {target: client.id, action: 'monitor'})">
|
||||||
monitor
|
monitor
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
data-eval="client.points += named.points.valueAsNumber;
|
data-eval="client.points += named.points.valueAsNumber;
|
||||||
send('points', {id: client.id, points: client.points})"
|
conn.send('points', {id: client.id, points: client.points})"
|
||||||
>
|
>
|
||||||
add points
|
add points
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
data-eval="client.tokens += named.tokens.valueAsNumber;
|
data-eval="client.tokens += named.tokens.valueAsNumber;
|
||||||
send('tokens', {id: client.id, tokens: client.tokens})"
|
conn.send('tokens', {id: client.id, tokens: client.tokens})"
|
||||||
>
|
>
|
||||||
add tokens
|
add tokens
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ async def handle_messages(client: Client):
|
||||||
target.play_points = points
|
target.play_points = points
|
||||||
elif mdata["type"] == "tokens":
|
elif mdata["type"] == "tokens":
|
||||||
target.play_tokens = points
|
target.play_tokens = points
|
||||||
await broadcast_client(client)
|
await broadcast_client(target)
|
||||||
elif mdata["type"] == "login":
|
elif mdata["type"] == "login":
|
||||||
target_id = UserId(mdata["value"]["id"])
|
target_id = UserId(mdata["value"]["id"])
|
||||||
target = client.session.clients.get(target_id)
|
target = client.session.clients.get(target_id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue