mirror of
https://github.com/solero/houdini.git
synced 2025-01-25 21:57:03 +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.frame = 1
|
||||||
p.toy = None
|
p.toy = None
|
||||||
|
|
||||||
|
async def refresh(self, p):
|
||||||
|
await p.send_xt('grs', self.id, await self.get_string())
|
||||||
|
|
||||||
async def get_string(self):
|
async def get_string(self):
|
||||||
return '%'.join([await p.string for p in self.penguins])
|
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):
|
async def handle_join_room(p, room: Room, x: int, y: int):
|
||||||
p.x, p.y = x, y
|
p.x, p.y = x, y
|
||||||
await p.join_room(room)
|
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