From fdc092990d5e3b9a28e7b646047a877e2cd88dcc Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 29 Mar 2020 23:20:35 +0200 Subject: Change the websocket library for the standard one Signed-off-by: Olivier Gayot --- swiftstory/Player.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'swiftstory/Player.py') diff --git a/swiftstory/Player.py b/swiftstory/Player.py index cc64d17..a1d6cda 100644 --- a/swiftstory/Player.py +++ b/swiftstory/Player.py @@ -22,9 +22,9 @@ class Player(): def set_has_played(self, has=True): self.has_played = has - def inc_score(self): + async def inc_score(self): self.score += 1 - self.send_notification({ + await self.send_notification({ 'op': 'updated_score', 'content': self.score, }) @@ -34,10 +34,10 @@ class Player(): self.next_idx += 1 return self.next_idx - 1 - def send_notification(self, obj): + async def send_notification(self, obj): if self.client is None: return message = json.dumps({'type': 'notification', 'content': obj}) - self.client.send_notification(message) + await self.client.send_notification(message) -- cgit v1.2.3