From 889fa1020eed529802571c8655886531998ae79f Mon Sep 17 00:00:00 2001 From: klafyvel Date: Sat, 13 Jan 2018 01:02:44 +0100 Subject: [PATCH] =?UTF-8?q?Chargement=20de=20l'=C3=A9tat=20au=20d=C3=A9mar?= =?UTF-8?q?rage=20et=20correction=20de=20l'immunit=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roulette.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roulette.py b/roulette.py index 6517881..97f6ea9 100644 --- a/roulette.py +++ b/roulette.py @@ -28,6 +28,10 @@ ASSHOLES_FILE = '/var/roulette/assholes' STATE_FILE = '/var/roulette/state' STATE = 'down' +#Actualisation de l'etat de la roulette +with open(STATE_FILE, 'r') as f: + STATE = f.read() + app = Flask(__name__) app.config.from_object(__name__) @@ -170,8 +174,10 @@ def get_players_not_banned(): def cheat(player_id, target_id): success = random.choice([True, False]) + with open(IMMUNITY_FILE, 'r') as f: + immunity = f.read() try: - ok = [line.strip().partition(' ') for line in IMMUNITY] + ok = [line.strip().partition(' ') for line in immunity] ok = [get_player_from_full_name(names[0], names[2])['id'] for names in ok] ko = [line.strip().partition(' ') for line in ASSHOLES]