Closed thesadru closed 2 years ago
Anyone else noticing that when using the temporary alternative above, client.claim_daily_rewards()
will return reward data strings with Genshin-themed items instead?
It will check-in Honkai just fine, just that name
and amount
parameters will be filled with Genshin-themed items for some reason, lmao
For example, back in March 5th, for me Honkai check-in returned Fine Enhancement Ore x 3 as the reward (Genshin's that day was Adventurer's Experience x 2, so there was seemingly no connection) Then the next day it was Mora for some reason..
I ended up relying on data from client.claimed_rewards(limit=1)
as it happens to be always accurate on my case
But yeah, it was pretty strange
EDIT:
I looked back into Genshin daily check-in page, and can confirm that the Genshin-themed items were related to my days of Honkai check-in March 5th was Fine Enhancement Ore x 3 because that was my Honkai's 2nd-day daily check-in, and that was indeed the item for day 2 for Genshin (but it was day 6 for my Genshin's hence Adventurer's Experience x 2) Same applied for the following day
So yeah, it seems reward data strings for client.claim_daily_rewards()
will somehow use Genshin's, but client.claimed_rewards()
will correctly use Honkai's
I also noticed that if you had already checked-in that day, client.claim_daily_rewards()
would also correctly use Honkai's
It'd just use Genshin's when you hadn't checked-in
Again, this only affect the reward data strings as returned by the function It will still check-in Honkai just fine regardless of what it returns
Could you please enable debug mode to see the endpoints that are being requested?
Turned it on earlier, and tried with just Honkai check-in, and it successfully used Honkai data strings (endpoints were correct)
Hmm, I think it must have been an error on my part I ran my Genshin and Honkai check-in concurrently , and Genshin's code was made to be called slightly earlier, so perhaps back then it was some racing something with Genshin endpoint url in the lib side maybe My bad, not too used to Python yet 🙏
Here I am again.. 😅
But yeah, it apparently didn't seem to be caused by running both check-ins concurrently
Even when running them in sequence, where a previous client.close()
was also properly awaited before proceeding to init a new client, Honkai's rewards still go all funky
Based on endpoint logging, nothing seemed out of place, but rewards data still go funky
I let it run for 2 days in a row and data was funky for both days
I think I have identified the issue. The monthly reward cache does not differentiate between different games.
For a temporary fix you can do:
class HonkaiClient(genshin.GenshinClient):
ACT_ID = "e202110291205111"
REWARD_URL = "https://api-os-takumi.mihoyo.com/event/mani/"
async def get_monthly_rewards(self, *, lang: str = None) -> List[genshin.DailyReward]:
data = await self.request_daily_reward("home", lang=lang)
return [genshin.DailyReward(**i) for i in data["awards"]]
Since honkai has its own daily sign-in rewards it'd be nice to support it in genshin.py.
The logic is the exact same, only the base url and act id differ. The biggest problem is figuring out how to properly implement it without much repetition.
Currently, users can use: