mirror of
https://github.com/solero/houdini.git
synced 2024-11-10 05:08:19 +00:00
Refresh room handler
This commit is contained in:
parent
2f0da637d2
commit
c51dfc12d8
@ -43,6 +43,9 @@ class Room(db.Model):
|
||||
p.frame = 1
|
||||
p.toy = None
|
||||
|
||||
async def refresh(self, p):
|
||||
await p.send_xt('grs', self.id, await self.get_string())
|
||||
|
||||
async def get_string(self):
|
||||
return '%'.join([await p.string for p in self.penguins])
|
||||
|
||||
|
@ -51,3 +51,8 @@ async def handle_join_server(p, penguin_id: int, login_key: str):
|
||||
async def handle_join_room(p, room: Room, x: int, y: int):
|
||||
p.x, p.y = x, y
|
||||
await p.join_room(room)
|
||||
|
||||
|
||||
@handlers.handler(XTPacket('j', 'grs'))
|
||||
async def handle_refresh_room(p):
|
||||
await p.room.refresh(p)
|
||||
|
Loading…
Reference in New Issue
Block a user