diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2015-06-04 05:54:16 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2015-06-04 05:54:16 +0100 |
commit | 0cae8115a93589e37943590db45967beec841a07 (patch) | |
tree | ad5bbecff01e42362d3670b90000fa77e9d38cc9 /CAO_Client.py | |
parent | 7d191b337b3114ceaa2ea69b538d3cd4f83bc094 (diff) |
added a system of notification
what the client will receive will look like:
{'type': TYPE, 'content': CONTENT}
TYPE will be either 'notification' or 'response'
CONTENT will be the content of the notification or the response
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'CAO_Client.py')
-rw-r--r-- | CAO_Client.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CAO_Client.py b/CAO_Client.py index 6eccc2d..b9da42a 100644 --- a/CAO_Client.py +++ b/CAO_Client.py @@ -2,10 +2,12 @@ from CAO_Status import cao_error from CAO_Game import CAO_Game class CAO_Client(): - def __init__(self, game_manager): + def __init__(self, socket, handler, game_manager): self.game = None self.game_manager = game_manager + self.handler = handler + self.socket = socket self.player = None def join_game(self, game_name): @@ -56,3 +58,6 @@ class CAO_Client(): if self.game is None: return cao_error('You have to join a game first') return self.game.try_view_black_card(self.player) + + def send_notification(self, message): + self.socket.send_message(self.handler, message) |