Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completing one campaign completes both for the same game #418

Open
mgbeck002 opened this issue Jan 18, 2024 · 3 comments
Open

Completing one campaign completes both for the same game #418

mgbeck002 opened this issue Jan 18, 2024 · 3 comments
Labels
Bug Something isn't working

Comments

@mgbeck002
Copy link

I've been experiencing this with Out of the Park Baseball. They typically have an official and an affiliate campaign each day, as shown in the screenshot below.
image

So far today, only affiliates have streamed and I should still have the "Official" campaign available to me, but it's marked as completed in the application and the application will no longer join the official channel.

Inventory screenshot:
image

This is with commit 91f2dac on Windows 11, running both as a built executable and when run as a python application directly.

@DevilXD DevilXD added the Bug Something isn't working label Jan 18, 2024
@DevilXD
Copy link
Owner

DevilXD commented Jan 18, 2024

Hello o/

I've roughly explained "the issue" of trying to determine if a campaign has been finished or not, here: #334 (comment)

There is no fix for this, the logic works correctly. The developer of this campaign has used repeating benefits, which can "cross-claim" a campaign in the miner like that. It works like this:

  • You mine a campaign which has a drop with a repeating benefit X.
  • There's another campaign active at the same time, with all drops that have the same benefit to it.
  • The logic processes the second campaign and determines that all drops from it have already been claimed (from the first campaign), because all benefits from it were claimed while the campaign was active.
  • The result is a not-started-yet campaign being all marked as claimed and finished.

That's the bad news. The good news is that - you can force a campaign like that to appear in your inventory, by watching an applicable channel for at least one minute. Once it does so, and all drops receive a 0% progression bar, the miner will automatically pick up on that, and should continue from there - after a reload, of course. Every further campaign that runs into this issue, has to be started "manually" like this.

Please let me know if that worked out for you.

Repository owner deleted a comment from AlKebrit Jan 20, 2024
@mgbeck002
Copy link
Author

Thanks. Yeah. That workaround seems to work. For my curiosity, what part of the code is the part that claims the drops?

@DevilXD
Copy link
Owner

DevilXD commented Jan 20, 2024

Thanks. Yeah. That workaround seems to work.

Cool =)

For my curiosity, what part of the code is the part that claims the drops?

The exact code that performs the claim operation is here:

async def _claim(self) -> bool:
"""
Returns True if the claim succeeded, False otherwise.
"""
if self.is_claimed:
return True
if not self.can_claim:
return False
response = await self._twitch.gql_request(
GQL_OPERATIONS["ClaimDrop"].with_variables(
{"input": {"dropInstanceID": self.claim_id}}
)
)
data = response["data"]
if "errors" in data and data["errors"]:
return False
elif "claimDropRewards" in data:
if not data["claimDropRewards"]:
return False
elif (
data["claimDropRewards"]["status"]
in ["ELIGIBLE_FOR_ALL", "DROP_INSTANCE_ALREADY_CLAIMED"]
):
return True
return False

But to authorize the claim, you need to have an authorization key (a string of characters obtained back from the login procedure, that authorizes each request to the Twitch servers the miner makes), and a claim ID, that's generated by Twitch once the drop progress reaches 100%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants