Broadcast pickup and drop system chat messages to other users

This commit is contained in:
Jage9
2026-02-27 02:39:25 -05:00
parent 31ecb8eb5c
commit 1508e7e371
3 changed files with 20 additions and 1 deletions

View File

@@ -1753,6 +1753,15 @@ class SignalingServer:
item.updatedByName = actor_name
await self._broadcast_item(item)
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)
return
@@ -1776,6 +1785,15 @@ class SignalingServer:
item.updatedByName = actor_name
await self._broadcast_item(item)
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)
return