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 drop of a campaign swithces to another campaign #422

Open
AlKebrit opened this issue Jan 20, 2024 · 4 comments
Open

Completing one drop of a campaign swithces to another campaign #422

AlKebrit opened this issue Jan 20, 2024 · 4 comments
Labels
Help / Issue General or specific issues that just require some additional assistance to solve

Comments

@AlKebrit
Copy link

as you can see there are currently 5 campaigns in rust
TDMTIR
when I first used the app it started watching Frost_ to claim Rust Captain drops but once it finished the first drop of Rust Captain it switched to trausi to claim Rust Players campaign without completing Captain Campaign which is the first campaign it started watching.
after completing the first drop of Rust Player it switched to hjune and started claiming his drops but hjune didn't have this problem it kept watching hjune until all of his drops were claimed and it got stuck on hjune kept watching hjune while trying to claim drops from other campaigns he doesn't have. I don't know why but I think because hjune was the most watched streamer in Rust he was at the top all the time maybe that's why it got stuck there.
I tried reloading the app from settings it didn't fix the issue of being stuck on hjune but the bar that says which drop it's currently progressing on was at 50% or so and it got back to 0% cause it wasnt actually progressing in that drop it kept progressing in the app but what I see in my twitch inventory outside the app says 0% and it was not going up until I restarted the app. once I did it finally switched from watching hjune to watching a streamer in the Rust Captain Campaign. so I just kept checking on it manually every few hours and restarting it if it's not progressing. later on, I set it up to auto-run at log-on in Task Scheduler and restart every hour. All my issues were fixed here. I don't have any issues currently using the auto-restart method.

Now I'm claiming all my drops automatically without opening the app or doing anything i set it up to auto-open when I log on to my PC in tray mode. Because I don't have any issues using this method I didn't feel like posting about my problem.

thank you for the amazing app it's a timer saver.

@DevilXD
Copy link
Owner

DevilXD commented Jan 20, 2024

Hello o/

when I first used the app it started watching Frost_ to claim Rust Captain drops but once it finished the first drop of Rust Captain it switched to trausi to claim Rust Players campaign without completing Captain Campaign which is the first campaign it started watching.
after completing the first drop of Rust Player it switched to hjune and started claiming his drops but hjune didn't have this problem it kept watching hjune until all of his drops were claimed

All of this is intended behavior. If there is multiple campaigns available at once, and they all have the same priority according to the priority list, then the miner will watch whatever streamer has the greatest amount of viewers at the time, since that's how the channels list is sorted by at the end, and that's also how the next channel to watch is selected. This means that, every time an automatic reload happens, the channel can change, and with it, the campaign that's being progressed as well.

it got stuck on hjune kept watching hjune while trying to claim drops from other campaigns he doesn't have. I don't know why but I think because hjune was the most watched streamer in Rust he was at the top all the time maybe that's why it got stuck there.

This is a bug that's already tracked by #301. "trying to claim drops from other campaigns he doesn't have" is not a thing, the miner will only watch a channel that can actually progress any campaign, but the information that lets you decide about that sometimes isn't updated (#301), which can make it stuck on a drop that should be completed, but isn't.

I tried reloading the app from settings it didn't fix the issue of being stuck on hjune but the bar that says which drop it's currently progressing on was at 50% or so and it got back to 0% cause it wasnt actually progressing in that drop it kept progressing in the app but what I see in my twitch inventory outside the app says 0% and it was not going up until I restarted the app.

Again, more #301. Issue is known and being worked on. You can check out the discussion there to see if anything there helps.

once I did it finally switched from watching hjune to watching a streamer in the Rust Captain Campaign. so I just kept checking on it manually every few hours and restarting it if it's not progressing.

That works, but it should really be doing that without having to baby-sit it. There might be some Twitch internal machinery cooldowns coming into play here, where you're better of just shutting down the miner entirely, giving it at least 5 minutes of break, and then opening it again. That should reset everything on the Twitch server side, and proceed more smoothly from then on.

later on, I set it up to auto-run at log-on in Task Scheduler and restart every hour. All my issues were fixed here. I don't have any issues currently using the auto-restart method.

As I've mentioned before, auto-restart shouldn't be necessary, as the maintenance task will already reload the application every hour for you, and that should make it unstuck on it's own. If pressing the Reload button (not restarting) doesn't make it unstuck, then it may suggest an internal error with the miner. However, you'd have the traceback of that error displayed in the output window. I'd need that traceback to further diagnose the issue.

@DevilXD DevilXD added the Help / Issue General or specific issues that just require some additional assistance to solve label Jan 20, 2024
@AlKebrit
Copy link
Author

i have claimed all my drops already so it just says no active campaign.

If pressing the Reload button (not restarting) doesn't make it unstuck, then it may suggest an internal error with the miner. However, you'd have the traceback of that error displayed in the output window. I'd need that traceback to further diagnose the issue.

where does it show that? cause i haven't seen any errors in the miner window.

i think if reloading the miner functioned like a restart it would fix the problem entirely. like why does switch streamer on reload sometimes and not always? maybe just rewatch the same streamer or switch to another but not keep watching the same streamer without reselecting it

@DevilXD
Copy link
Owner

DevilXD commented Jan 22, 2024

where does it show that?

Output window of the miner, here:
picture

You may need to scroll up to see

if reloading the miner functioned like a restart it would fix the problem entirely

It already does so. There is some very specific conditions, where a restart would work better than a reload at resolving an issue, but for that to happen, a traceback would be printed out to the Output window. If it does so, I need to to resolve the issue. If it doesn't, then a reload is just as good as a restart, and the miner should reload itself automatically every hour, without having to restart anything, and especially without having to setup any external scripts that'd restart it for you.

why does switch streamer on reload sometimes and not always?

The channel selection logic follows through a bunch of conditions, to determine if, when, and to which channel it should switch, in order to continue mining. These are:

  1. When the channels list is refreshed, the new and updated channel object replaces the old watching channel object. When this happens, a check is performed to ensure the channel can still be watched - if not, it's stopped being watched.

    TwitchDropsMiner/twitch.py

    Lines 960 to 970 in 9c0318d

    # relink watching channel after cleanup,
    # or stop watching it if it no longer qualifies
    # NOTE: this replaces 'self.watching_channel's internal value with the new object
    watching_channel = self.watching_channel.get_with_default(None)
    if watching_channel is not None:
    new_watching: Channel | None = channels.get(watching_channel.id)
    if new_watching is not None and self.can_watch(new_watching):
    self.watch(new_watching, update_status=False)
    else:
    # we've removed a channel we were watching
    self.stop_watching()

  2. Next, the current channel selection is considered, to allow the user to switch to the channel they'd like to select. The check additionally verifies if the selected channel is able to mine anything, and if so, it's chosen as the new watching channel.
    If there's no selection present, the list of channels (in the order as you can see them in the window), is first sorted with the game's priority value (since the list is initially sorted with that too, then usually there's no order changes), and then the channels are sequentially checked for mine-ability. Even if a channel can be mined, the should_switch check will prevent a switch from happening, unless the channel is found to have a higher priority game than the current watching channel (if the game/priority is the same, then no switch happens).

    TwitchDropsMiner/twitch.py

    Lines 993 to 1006 in 9c0318d

    new_watching = None
    selected_channel = self.gui.channels.get_selection()
    if selected_channel is not None and self.can_watch(selected_channel):
    # selected channel is checked first, and set as long as we can watch it
    new_watching = selected_channel
    else:
    # other channels additionally need to have a good reason
    # for a switch (including the watching one)
    # NOTE: we need to sort the channels every time because one channel
    # can end up streaming any game - channels aren't game-tied
    for channel in sorted(channels.values(), key=self.get_priority, reverse=True):
    if self.can_watch(channel) and self.should_switch(channel):
    new_watching = channel
    break

As you can see, the existing logic already tries to limit switching channels, unless it's necessary. If the channels were being switched as you say, then the miner had to have a good reason to be doing so - either those channels were actually offline and were deselected at step #​1, or they were online but stopped streaming Rust, or the streamer was restarting the stream in that very moment, or something else. We won't know, unless you have the output log from that particular run of the miner.

In either case, I'll need some actual logs to be able to help you. Please launch the miner with a -vvv flag, to enable more extensive logging of the application state, and if/when something like this would happen again, then save the resulting log to a text file and post it here for me to look at. You can enable automatic logging to a file with an additional --log flag as well.

@AlKebrit
Copy link
Author

thanks mate.
yeah i just realised my question about why dont the miner switch channels always is dumb my bad
i will see once rust drops come back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help / Issue General or specific issues that just require some additional assistance to solve
Projects
None yet
Development

No branches or pull requests

2 participants