-
Notifications
You must be signed in to change notification settings - Fork 14
checks if destiny is running. if not, clears the activity #49
base: master
Are you sure you want to change the base?
Conversation
This should be optional, as it would make the tool only usable by PC players - console players want the tool to run even though they don't have a Destiny2.exe process... |
Yep. you can add a config for that. Like, if a user puts in a battletag then ask if they want to use this instead? |
I moved some of the code around so if you have a flag for this in your configs, you can switch between the two. |
This project might have code to get it working for PS4 players: https://github.com/Frankity/Ps4Rpc There is probably something similar for xbox. If it requires the user to authenticate to get the info the ROI probably isnt high enough though. |
As much as I'd like to support Playstation and Xbox exactly the same, the fact they're running the game on a different platform is ofc a big limiter there. So, what'll be done for now is this for PC. To do so, we can use the membershipInformation that we get in the config. (@Akumati1435 please consider this in the upcoming work you'll do on this) What'll be done for other platforms will be investigated later (@mrphlip please create an issue to follow up on that). I'm doing a deep dive review on your code now @Akumati1435 (fair warning, I'm quite a demanding reviewer, I preach for quality over feature) |
like i said, i am not good with node.js. you really should just get an experienced node.js dev to turn what I wrote into a production quality version. I've written 10s of thousands of lines of c# code to automated my discord community but the bots I made with node.js are extremely basic. |
👍 Alright, we'll work from what you've done here then, tho, your contribution is much appreciated, I just try to keep the code as clean as it is right now :) |
Alright! I took me a full day of thinking (in the background), but I think I have a good proposition. When you'll start up the app, during the setting up phase, a new question will be asked to the user. It'll be something like:
If answered yes, we will do something based on this Pull Request, we will start polling Bungie API when we detect Destiny 2 being launched. If answered no, and that's what shall interest you @mrphlip we will continuously poll the API, but with a delay that'll increase exponentially. It'll start at 15s, the basic value, then double to 30s, then 1m, 2m, 5m, 15m, 30m, 1h. When we reach the two hours, what I'd name a final countdown/ Doomsday clock will start. We will keep polling every hour. But, 24hrs later after we reached the 1hr delay, the program will ~~ commit seppuku ~~ silently shut down. What do you think about that? |
I originally made this with ps-list, but after seeing how abysmal the performance was i switched off it. If you benchmark that vs the method I copy/pasted off stackoverflow, you'll notice a massive difference. I've heard ps-list takes up a lot of ram too for unknown reasons. If you have the program poll once an hour towards the end of it for console peasants, won't that mean up to an hour of the script not showing the discord integration? It seems like you can safely clear the game activity after some time, but you should still be monitoring the API for new activity at the same interval. Also, not sure if you have error handling for when bungie throws up, but it throws up a lot. For my stuff I keep a list of error codes to retry for in my configs. It has a min retry time, a max retry time, and a number of retries to attempt. It scales exponentially until it hits the max time, then continues to use the max time until the max number of retries is hit. |
The performance point is really interesting, thanks to bringing that up to
my attention, I'll check this out.
For console users, yes, I know, that's suboptimal, but I feel for Bungie
API. If even the inactive user start polling then every 15s, that's hell.
One thing I was thinking about to mitigate the problem is that in all case,
PC or console, you can stomp on your keyboard (i.e. press any key) and it
will trigger a refresh right away.
…On Sun., Jul. 7, 2019, 2:15 a.m. Akumati, ***@***.***> wrote:
I originally made this with ps-list, but after seeing how *abysmal* the
performance was i switched off it. If you benchmark that vs the method I
copy/pasted off stackoverflow, you'll notice a *massive* difference. I've
heard ps-list takes up a lot of ram too for unknown reasons.
If you have the program poll once an hour towards the end of it for
console peasants, won't that mean up to an hour of the script not showing
the discord integration? It seems like you can safely clear the game
activity after some time, but you should still be monitoring the API for
new activity at the same interval.
Also, not sure if you have error handling for when bungie throws up, but
it throws up a lot. For my stuff I keep a list of error codes to retry for
in my configs. It has a min retry time, a max retry time, and a number of
retries to attempt. It scales exponentially until it hits the max time,
then continues to use the max time until the max number of retries is hit.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#49?email_source=notifications&email_token=AC6LESW3CPYBKUVFPHUZFQLP6GCXPA5CNFSM4H6EIZP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLFK6Y#issuecomment-508974459>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC6LESWANOKXFFW35VY2B2LP6GCXPANCNFSM4H6EIZPQ>
.
|
For the retries, Darkscared is working on logs, which will by essence
include try catches.
What we aim to do certainly is that if it fail during an interval
execution, just keep going, we will try next time.
On Sun., Jul. 7, 2019, 4:35 a.m. Louis Bompart, <
[email protected]> wrote:
… The performance point is really interesting, thanks to bringing that up to
my attention, I'll check this out.
For console users, yes, I know, that's suboptimal, but I feel for Bungie
API. If even the inactive user start polling then every 15s, that's hell.
One thing I was thinking about to mitigate the problem is that in all case,
PC or console, you can stomp on your keyboard (i.e. press any key) and it
will trigger a refresh right away.
On Sun., Jul. 7, 2019, 2:15 a.m. Akumati, ***@***.***>
wrote:
> I originally made this with ps-list, but after seeing how *abysmal* the
> performance was i switched off it. If you benchmark that vs the method I
> copy/pasted off stackoverflow, you'll notice a *massive* difference.
> I've heard ps-list takes up a lot of ram too for unknown reasons.
>
> If you have the program poll once an hour towards the end of it for
> console peasants, won't that mean up to an hour of the script not showing
> the discord integration? It seems like you can safely clear the game
> activity after some time, but you should still be monitoring the API for
> new activity at the same interval.
>
> Also, not sure if you have error handling for when bungie throws up, but
> it throws up a lot. For my stuff I keep a list of error codes to retry for
> in my configs. It has a min retry time, a max retry time, and a number of
> retries to attempt. It scales exponentially until it hits the max time,
> then continues to use the max time until the max number of retries is hit.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#49?email_source=notifications&email_token=AC6LESW3CPYBKUVFPHUZFQLP6GCXPA5CNFSM4H6EIZP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLFK6Y#issuecomment-508974459>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AC6LESWANOKXFFW35VY2B2LP6GCXPANCNFSM4H6EIZPQ>
> .
>
|
The API can handle it. Just know the error codes that tell you to back off and you're fine. To put that into perspective... I'm slamming the API and I don't have problems. 1 call every 15 seconds is nothing. |
I wouldn't be worried if one person was polling every 15sec. I'm way more
concerned due to the alarming number of people that have reacted on Reddit
and the analytics of the GitHub.
It'd be like that we reach 100query per second or even more with the
current user base.
Keep in mind that due to privacy issue, the API key requirements will soon
be removed because we're gonna use one API Key and OAuth.
However, you're right that I might be underestimating the capacity of
Bungie's API.
Instead of 2hrs, we will refresh every minutes, and go from there.
What do you think of that?
We would keep the autoshut off tho.
…On Sun., Jul. 7, 2019, 12:22 p.m. Akumati, ***@***.***> wrote:
The API can handle it. Just know the error codes that tell you to back off
and you're fine.
To put that into perspective...
I've got 10 threads pulling character data for my clan and another 8 for
activity data. These jobs sometimes even overlap and I don't have issues.
The website I run uses the same VM and that hits the API too. Because I
have so many clans, the only way to get some of the webpages to load in a
reasonable amount of time is to thread the crap out of them.
I'm slamming the API and I don't have problems. 1 call every 15 seconds is
nothing.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#49?email_source=notifications&email_token=AC6LESR3XVX27XF3EONUZOTP6IJ4RA5CNFSM4H6EIZP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLOV5I#issuecomment-509012725>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC6LESSPEE7DJLM532XBHUDP6IJ4RANCNFSM4H6EIZPQ>
.
|
Every minute seems good. I dont think anyone would complain about it not showing their status correctly for a minute. Heck it might even help because until the user gets to orbit the information is wrong. If you switch to running the script as a service, the auto shut off might interfere with things. |
looks like visual studio messed with stuff a bit so this isnt as easy to compare...