From 6db8a9d943552b539b7bff232ce3c71bf4e730a0 Mon Sep 17 00:00:00 2001 From: Magic <82341152+MagicTheDev@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:53:13 -0500 Subject: [PATCH] add random element to hashing --- gamewide/war/track.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamewide/war/track.py b/gamewide/war/track.py index 96445aa..f95f268 100644 --- a/gamewide/war/track.py +++ b/gamewide/war/track.py @@ -2,6 +2,7 @@ import asyncio import coc import pendulum as pend +import random from hashids import Hashids from datetime import datetime @@ -232,7 +233,8 @@ async def get_war(clan_tag : str): if war_result.get("data") is not None: return - custom_id = hashids.encode(int(war.preparation_start_time.time.replace(tzinfo=pend.UTC).timestamp()) + int(pend.now(tz=pend.UTC).timestamp())) + + custom_id = hashids.encode(int(war.preparation_start_time.time.replace(tzinfo=pend.UTC).timestamp()) + int(pend.now(tz=pend.UTC).timestamp()) + random.randint(1000000000, 9999999999)) await db_client.clan_wars.update_one({"war_id": war_unique_id}, {"$set" : { "custom_id": custom_id,