diff --git a/game.py b/game.py index ebfd45f..fe9c431 100644 --- a/game.py +++ b/game.py @@ -20,7 +20,6 @@ class Player: players[self.id] = self def beginturn(self): - self.word = "" self.ready = False self.selection = -1 self.shuffle = list(range( len(self.game.cards) - 1)) # do not shuffle the last card (the skip turn card) @@ -41,7 +40,7 @@ class Player: del players[self.id] self.id = str(uuid.uuid4()) players[self.id] = self - self.word = str(word).strip() + self.word = " ".join(str(word).split()) # replace all whitespace character sequences to single space self.joined = True self.game.playerJoin() @@ -93,6 +92,7 @@ class Player: "me": { "id": self.id, "name": self.name, + "word": self.word, "selection": self.selection, "selected": self.selection >= 0, "ready": self.ready }, @@ -169,6 +169,10 @@ class Game: self.turnResult = 2 else: self.turnResult = 1 + if self.turnResult != 3: + for p in self.players: + if p.word == self.word: + p.word = "" def playerReady(self): if self.started and self.selected and all(p.ready for p in self.players): diff --git a/tpl/playerpage.tpl b/tpl/playerpage.tpl index 0525a88..3dd3704 100644 --- a/tpl/playerpage.tpl +++ b/tpl/playerpage.tpl @@ -20,7 +20,7 @@