mirror of
https://github.com/solero/houdini.git
synced 2025-10-17 21:08:17 +00:00
Give room objects penguins_by_id and penguins_by_username attributes
This commit is contained in:
@@ -10,9 +10,9 @@ async def handle_send_message(p, penguin_id: int, message: str):
|
||||
return await p.close()
|
||||
|
||||
if p.muted:
|
||||
for room_player in p.room.penguins:
|
||||
if room_player.data.moderator:
|
||||
await room_player.sendXt("mm", message, penguin_id)
|
||||
for penguin in p.room.penguins_by_id.values():
|
||||
if penguin.data.moderator:
|
||||
await penguin.send_xt("mm", message, penguin_id)
|
||||
return
|
||||
|
||||
if has_command_prefix(message):
|
||||
|
@@ -17,7 +17,7 @@ async def handle_close_book(p):
|
||||
|
||||
@handlers.handler(XTPacket('j', 'jr'), client=ClientType.Legacy)
|
||||
async def handle_join_room_toy(p):
|
||||
for penguin in p.room.penguins:
|
||||
for penguin in p.room.penguins_by_id.values():
|
||||
if penguin.toy is not None:
|
||||
await p.send_xt('at', penguin.data.id, penguin.toy)
|
||||
|
||||
@@ -25,6 +25,6 @@ async def handle_join_room_toy(p):
|
||||
@handlers.handler(XTPacket('j', 'crl'), client=ClientType.Vanilla)
|
||||
@handlers.depends_on_packet(XTPacket('j', 'jr'))
|
||||
async def handle_client_room_loaded_toy(p):
|
||||
for penguin in p.room.penguins:
|
||||
for penguin in p.room.penguins_by_id.values():
|
||||
if penguin.toy is not None:
|
||||
await p.send_xt('at', penguin.data.id, penguin.toy)
|
||||
|
Reference in New Issue
Block a user