diff options
author | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-03-29 23:20:35 +0200 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-03-29 23:52:42 +0200 |
commit | fdc092990d5e3b9a28e7b646047a877e2cd88dcc (patch) | |
tree | 76bc7aa7cbcc63db16e4631712971f937138240a /swiftstory/Player.py | |
parent | 6e44f62f44847643a697e56f42dbec77b72a5581 (diff) |
Change the websocket library for the standard one
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory/Player.py')
-rw-r--r-- | swiftstory/Player.py | 8 |
1 files changed, 4 insertions, 4 deletions
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) |