Broadcast pickup and drop system chat messages to other users
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Maintainer-controlled web client version.
|
// Maintainer-controlled web client version.
|
||||||
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
||||||
window.CHGRID_WEB_VERSION = "2026.02.27 R283";
|
window.CHGRID_WEB_VERSION = "2026.02.27 R284";
|
||||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ This is a behavior guide for packet semantics beyond raw schemas.
|
|||||||
- `item_upsert` is full-state replacement for one item, not partial patch.
|
- `item_upsert` is full-state replacement for one item, not partial patch.
|
||||||
- `item_upsert.item.display` is server-owned display text for readonly/system properties (for example: `createdBy`, `updatedBy`, `createdAt`, `updatedAt`, `capabilities`, `useSound`, `emitSound`).
|
- `item_upsert.item.display` is server-owned display text for readonly/system properties (for example: `createdBy`, `updatedBy`, `createdAt`, `updatedAt`, `capabilities`, `useSound`, `emitSound`).
|
||||||
- `item_action_result` messages are intended for direct screen-reader/user status feedback.
|
- `item_action_result` messages are intended for direct screen-reader/user status feedback.
|
||||||
|
- Successful `item_pickup` and `item_drop` also emit system chat lines to other users in the room.
|
||||||
- Piano runtime control no longer depends on parsing `item_action_result.message` text.
|
- Piano runtime control no longer depends on parsing `item_action_result.message` text.
|
||||||
- `item_piano_status` carries machine-readable piano events (`use_mode_entered`, record/playback transitions).
|
- `item_piano_status` carries machine-readable piano events (`use_mode_entered`, record/playback transitions).
|
||||||
- `item_use_sound` contains absolute item world coordinates (`x`, `y`) and sound path.
|
- `item_use_sound` contains absolute item world coordinates (`x`, `y`) and sound path.
|
||||||
|
|||||||
@@ -1753,6 +1753,15 @@ class SignalingServer:
|
|||||||
item.updatedByName = actor_name
|
item.updatedByName = actor_name
|
||||||
await self._broadcast_item(item)
|
await self._broadcast_item(item)
|
||||||
self._request_state_save()
|
self._request_state_save()
|
||||||
|
item_text = f"{item.title} ({self._item_type_label(item)})"
|
||||||
|
await self._broadcast(
|
||||||
|
BroadcastChatMessagePacket(
|
||||||
|
type="chat_message",
|
||||||
|
message=f"{client.nickname} picked up {item_text}.",
|
||||||
|
system=True,
|
||||||
|
),
|
||||||
|
exclude=client.websocket,
|
||||||
|
)
|
||||||
await self._send_item_result(client, True, "pickup", f"Picked up {item.title}.", item.id)
|
await self._send_item_result(client, True, "pickup", f"Picked up {item.title}.", item.id)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1776,6 +1785,15 @@ class SignalingServer:
|
|||||||
item.updatedByName = actor_name
|
item.updatedByName = actor_name
|
||||||
await self._broadcast_item(item)
|
await self._broadcast_item(item)
|
||||||
self._request_state_save()
|
self._request_state_save()
|
||||||
|
item_text = f"{item.title} ({self._item_type_label(item)})"
|
||||||
|
await self._broadcast(
|
||||||
|
BroadcastChatMessagePacket(
|
||||||
|
type="chat_message",
|
||||||
|
message=f"{client.nickname} dropped {item_text} at {item.x}, {item.y}.",
|
||||||
|
system=True,
|
||||||
|
),
|
||||||
|
exclude=client.websocket,
|
||||||
|
)
|
||||||
await self._send_item_result(client, True, "drop", f"Dropped {item.title}.", item.id)
|
await self._send_item_result(client, True, "drop", f"Dropped {item.title}.", item.id)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user