From abd360d9fd6dc1a77cd38c213bc9532d85973ca0 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 8 Jun 2015 04:49:37 +0100 Subject: the server now handles the language properly Signed-off-by: Olivier Gayot --- CAO_Client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'CAO_Client.py') 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): -- cgit v1.2.3