diff options
author | Philip Paquette <pcpaquette@gmail.com> | 2018-11-13 15:02:07 -0500 |
---|---|---|
committer | Philip Paquette <pcpaquette@gmail.com> | 2019-04-18 11:20:05 -0400 |
commit | f2de602a988a1548cc8c4a5eb855b1db3c247216 (patch) | |
tree | e41acd3c39e8b9e95a1c7d67439334643f4dac9d /diplomacy/engine | |
parent | 3924ed59b6d69a9d79ccd5f9ce4c3f163fa36d47 (diff) |
game_id - Using a random stream of 96 bits encoded as base64
Diffstat (limited to 'diplomacy/engine')
-rw-r--r-- | diplomacy/engine/game.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/diplomacy/engine/game.py b/diplomacy/engine/game.py index 3f218e4..03a25af 100644 --- a/diplomacy/engine/game.py +++ b/diplomacy/engine/game.py @@ -19,10 +19,10 @@ - Contains the game engine """ # pylint: disable=too-many-lines +import base64 import os import sys import time -import uuid import random from copy import deepcopy @@ -266,7 +266,7 @@ class Game(Jsonable): # Check game ID. if self.game_id is None: - self.game_id = '%s/%s' % (self.timestamp_created, uuid.uuid4()) + self.game_id = base64.b64encode(os.urandom(12), b'-_').decode('utf-8') # Validating status self._validate_status(reinit_powers=(self.timestamp_created is None)) |