mirror of
https://github.com/solero/houdini.git
synced 2024-11-08 20:28:20 +00:00
Mascot stamp handler
This commit is contained in:
parent
d9d84508cd
commit
a521395e80
@ -1,6 +1,6 @@
|
||||
from houdini import handlers
|
||||
from houdini.handlers import XTPacket
|
||||
from houdini.handlers.play.navigation import handle_join_server
|
||||
from houdini.handlers.play.navigation import handle_join_server, handle_join_room
|
||||
from houdini.data.stamp import Stamp, CoverStamp, CoverItem, PenguinStampCollection
|
||||
from houdini.data.penguin import Penguin
|
||||
|
||||
@ -60,6 +60,21 @@ async def handle_get_stamps(p):
|
||||
await p.send_xt('gps', p.id, await get_player_stamps_string(p, p.id))
|
||||
|
||||
|
||||
@handlers.handler(XTPacket('j', 'jr'), after=handle_join_room)
|
||||
async def handle_add_mascot_stamp(p):
|
||||
if p.character is not None:
|
||||
character = p.server.characters[p.character]
|
||||
stamp = p.server.stamps[character.stamp_id]
|
||||
for penguin in p.room.penguins_by_id.values():
|
||||
await penguin.add_stamp(stamp)
|
||||
|
||||
for penguin in p.room.penguins_by_id.values():
|
||||
if penguin.character is not None:
|
||||
character = p.server.characters[penguin.character]
|
||||
stamp = p.server.stamps[character.stamp_id]
|
||||
await p.add_stamp(stamp)
|
||||
|
||||
|
||||
@handlers.handler(XTPacket('st', 'gps'))
|
||||
@handlers.cooldown(1)
|
||||
async def handle_get_player_stamps(p, player_id: int):
|
||||
|
Loading…
Reference in New Issue
Block a user