From d93f7067283eeb3a096ebcdf85a129458fb6a600 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joann=20M=C3=B5ndresku?= Date: Mon, 13 May 2024 20:57:19 +0300 Subject: [PATCH] Fix contract scheduling and array events --- contracts.py | 1 + events.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts.py b/contracts.py index 17d2bbf..f47a63a 100644 --- a/contracts.py +++ b/contracts.py @@ -56,6 +56,7 @@ def __convert_contract_to_proto(obj): def load_contracts(): with open("data/contracts.json", "r") as file: obj = json.loads(file.read()) + global contract_epoch contract_epoch = obj["epoch"] time_since_epoch = time.time() - contract_epoch i = 0 diff --git a/events.py b/events.py index 50634dc..3cc34bf 100644 --- a/events.py +++ b/events.py @@ -77,13 +77,13 @@ def get_active_events(): iso_calendar = date.isocalendar() seed = int(str(iso_calendar.year) + str(iso_calendar.week)) srng = random.Random(seed) - # 50/50 chance of it being either + # 50/50 chance of it being either (reality is something more like 30/70 ratio, but it's our server so.. \o/) if srng.random() < 0.5: res.append(double_prestige_event) else: res.append(triple_prestige_event) if type(event_calendar[cur_day]) is list: - res = event_calendar[cur_day] + res = res + event_calendar[cur_day] else: res.append(event_calendar[cur_day]) # Apply duration deltas -- 2.25.1