summaryrefslogtreecommitdiff
path: root/CAO_Client.py
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-08 04:49:37 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-08 04:59:14 +0100
commitabd360d9fd6dc1a77cd38c213bc9532d85973ca0 (patch)
treee873599c621e31829fd942982dfda2780258a9a7 /CAO_Client.py
parent9d7f0754ff9db1645635647f4acd63aa38c173c5 (diff)
the server now handles the language properly
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'CAO_Client.py')
-rw-r--r--CAO_Client.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/CAO_Client.py b/CAO_Client.py
index bdcc000..c3554ac 100644
--- a/CAO_Client.py
+++ b/CAO_Client.py
@@ -10,13 +10,19 @@ class CAO_Client():
self.socket = socket
self.player = None
- def join_game(self, game_name):
+ def join_game(self, game_name, lang):
if self.game is not None:
return cao_error('You are already in a game')
- game = self.game_manager.join_game(game_name)
+ if lang is None:
+ lang = 'en'
+
+ game = self.game_manager.join_game(game_name, lang)
# XXX self.game will be assigned by game.try_join()
+ if game is None:
+ return cao_error('Invalid language')
+
return game.try_join(self)
def set_game(self, game):