From 44bf627dc5904f8f967b733e10022e5b87848adf Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 6 Apr 2020 19:27:46 +0100 Subject: [PATCH 1/2] Use `fromtimestamp` instead of `utcfromtimestamp` to calculate rainbow quest availability --- houdini/handlers/play/rainbow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/houdini/handlers/play/rainbow.py b/houdini/handlers/play/rainbow.py index 732e2bb..a3e4f70 100644 --- a/houdini/handlers/play/rainbow.py +++ b/houdini/handlers/play/rainbow.py @@ -51,7 +51,8 @@ async def handle_rainbow_quest_cookie(p): if task_completion: quest_wait = RainbowQuestWaitMember if p.is_member else RainbowQuestWait - task_availability = datetime.utcfromtimestamp(int(task_completion)) + quest_wait + task_availability = datetime.fromtimestamp(int(task_completion)) + quest_wait + minutes_remaining = int((task_availability - current_datetime).total_seconds() // 60) task_availability_unix = task_availability.timestamp() else: From fdd290e868be74345886e636441b3866c81aa34b Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 6 Apr 2020 19:28:23 +0100 Subject: [PATCH 2/2] Subtract 1 from index_of_before in handler ordering logic --- houdini/handlers/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/houdini/handlers/__init__.py b/houdini/handlers/__init__.py index f87d836..d0de0c9 100644 --- a/houdini/handlers/__init__.py +++ b/houdini/handlers/__init__.py @@ -166,7 +166,7 @@ class _ListenerManager(_AbstractManager): if listener_object.before is not None: index_of_before = self[listener_object.packet].index(listener_object.before) old_index = self[listener_object.packet].index(listener_object) - self[listener_object.packet].insert(index_of_before, self[listener_object.packet].pop(old_index)) + self[listener_object.packet].insert(index_of_before - 1, self[listener_object.packet].pop(old_index)) if listener_object.after is not None: index_of_after = self[listener_object.packet].index(listener_object.after) old_index = self[listener_object.packet].index(listener_object)