zeropingheroes / lancache-autofill

Automatically fill a Lancache with content
GNU General Public License v3.0
132 stars 24 forks source link

Allow paid apps to be excluded with queue-users-owned-apps #56

Closed jdmcmahan closed 3 years ago

jdmcmahan commented 3 years ago

Fixes #55.

billthecatt commented 3 years ago

This is awesome. Thanks so much for the quick turnaround on this. Its awesome to see this project continuing to get support even if the original creator is MIA (we hope temporarily of course, and tyvm to the original creator!)

billthecatt commented 3 years ago

Er, sorry. could you put this new functionality into your branch @ https://github.com/jdmcmahan/lancache-autofill so that we can just git fetch from that git and get all of this stuff streamlined?

I did a git fetch on https://github.com/jdmcmahan/lancache-autofill and i'm seeing the following:

user1@autofill:~/lancache-autofill$ ./lancache-autofill steam:queue-users-owned-apps --include_paid=false

The "--include_paid" option does not exist.

Understanding this may be part of a branch, but not quite clear on how to get this code working in from the CLI.. Any hints on how to pull a branch from a remote git repo via a the CLI?

billthecatt commented 3 years ago

If anyone else wants to test this code here is the correct CLI syntax:

git clone https://github.com/jdmcmahan/lancache-autofill git checkout --track remotes/origin/exclude-paid-apps

billthecatt commented 3 years ago

Seems something is up here. After correctly pulling this branch and testing the new code I'm getting the following error:

user1@autofill:~/lancache-autofill$ ./lancache-autofill steam:queue-users-owned-apps ../steam64s.txt --include_paid=false

In Collection.php line 1706:

Undefined offset: 0

billthecatt commented 3 years ago

This seems to be an issue even if I bypass the file of steam64 IDs and use a single one:

user1@autofill:~/lancache-autofill$ ./lancache-autofill steam:queue-users-owned-apps 76561198843 --include_paid=false

In Collection.php line 1706:

Undefined offset: 0

jdmcmahan commented 3 years ago

If anyone else wants to test this code here is the correct CLI syntax:

git clone https://github.com/jdmcmahan/lancache-autofill git checkout --track remotes/origin/exclude-paid-apps

Sorry, in hindsight I probably should've just added these changes to master and the original PR. For some reason I had it in my head that the --include_free option was also used in other commands, and I wanted to be sure to backport these changes regardless of the queue-users-recent-apps functionality. Apparently my memory doesn't last 2 weeks XD

In any case, your Git commands should do the trick!

This seems to be an issue even if I bypass the file of steam64 IDs and use a single one:

user1@autofill:~/lancache-autofill$ ./lancache-autofill steam:queue-users-owned-apps 76561198843 --include_paid=false

In Collection.php line 1706:

Undefined offset: 0

I have a hunch as to why this might be happening. Let me see if I can reproduce it with the 76561198843 ID.

Thanks!

billthecatt commented 3 years ago

This seems to happen with quite a few of the steamIDs I have in my steam64 file, but not all of them.. Wondering if there is a property of those specific steamIDs that cause it to fail for them, if so can we have it fail with grace and throw an appropriate error message?

billthecatt commented 3 years ago

Also, there is a message field in the app DB, that's generally unused... Could we populate this with "FreeApp" so that we can differentiate between the paid and free apps?

I ask this because, even though the game is free, sometimes/often you have to login to steam using the windows client and subscribe to the content to get it to download correctly. Knowing which games we need to do that for

jdmcmahan commented 3 years ago

This seems to happen with quite a few of the steamIDs I have in my steam64 file, but not all of them.. Wondering if there is a property of those specific steamIDs that cause it to fail for them, if so can we have it fail with grace and throw an appropriate error message?

I'm thinking this has more to do with specific apps which are owned by certain Steam accounts but not others. I've tested successfully with my own account, but I can see where apps with incomplete details (from the Steam API) could cause issues.

The latest commit should address this with a warning. Can you give it a try?

git pull origin master

Also, there is a message field in the app DB, that's generally unused... Could we populate this with "FreeApp" so that we can differentiate between the paid and free apps?

I ask this because, even though the game is free, sometimes/often you have to login to steam using the windows client and subscribe to the content to get it to download correctly. Knowing which games we need to do that for

TBH I've never seen a value for the message field, so I'm not sure what the original intentions were. I can think of several columns that could be useful in addition to your suggestion.

Keep in mind that the Steam API will only include a free game if the player has already subscribed to that game. Check out https://partner.steamgames.com/doc/webapi/IPlayerService#GetOwnedGames:

Free games are excluded by default. If this is set, free games the user has played will be returned.

edit: realized we're saying the same thing

billthecatt commented 3 years ago

The latest commit should address this with a warning. Can you give it a try?

Unable to determine whether app Tom Clancy's Rainbow Six Siege - Test Server (623990) is free to play, skipping Unable to determine whether app Arma 2: Operation Arrowhead Beta (Obsolete) (219540) is free to play, skipping Steam app "AirBuccaneers" on platform "Windows" already in download queue Steam app "Alien Swarm: Reactive Drop" on platform "Windows" already in download queue Steam app "Counter-Strike: Global Offensive" on platform "Windows" already in download queue

That's super cool. Very nice work. Thanks for the uber quick turnaround time!

billthecatt commented 3 years ago

This might need the rate limiting treatment that this app has in other places.. After doing an entire file of these, I got the following error:

Client error: GET http://store.steampowered.com/api/appdetails/?appids=244070&key=REDACTED&format=json resulted in a 429 Too Many Requests response: null

It's working great otherwise!

jdmcmahan commented 3 years ago

Unable to determine whether app Tom Clancy's Rainbow Six Siege - Test Server (623990) is free to play, skipping Unable to determine whether app Arma 2: Operation Arrowhead Beta (Obsolete) (219540) is free to play, skipping

It looks like these apps don't show up in the store, which would explain why the data was incomplete. The syntax/steam-api library uses the Steam Store API for getting app details. Here's the raw response:

curl https://store.steampowered.com/api/appdetails?appids=623990
{
    "623990": {
        "success": false
    }
}

Just for future reference in case anyone has ideas for improving this.

jdmcmahan commented 3 years ago

This might need the rate limiting treatment that this app has in other places.. After doing an entire file of these, I got the following error:

Client error: GET http://store.steampowered.com/api/appdetails/?appids=244070&key=REDACTED&format=json resulted in a 429 Too Many Requests response: null

It's working great otherwise!

Interesting... I'm actually using the same rate limiter as the rest of the application, but perhaps the Steam Store API has different rate limits. I'll take a look!

FYI your API key is visible in your comment ;)

billthecatt commented 3 years ago

FYI your API key is visible in your comment ;)

Thanks, fixed.. Appreciate you! Very glad to see dev work on this project continuing. Wondering if we should just consider this a full blown fork and start making comments and opening issues on your own git?

billthecatt commented 3 years ago

Thea ability to do this level of data-mining on LAN attendees is really cool.

Do you have any idea what I'd have to ask them to set to get the non responsive steamIDs to return data? I'm getting data for a bunch of irregulars and all my regular attendees aren't returning data. I'm pretty sure I could ask most of them to change whatever it is about their profiles that's causing this, if I knew what it was..

jdmcmahan commented 3 years ago

Wondering if we should just consider this a full blown fork and start making comments and opening issues on your own git?

@ilumos what's the status of this project?

Fair warning: I actually have very little experience with PHP. I love the "Yes, it's written in PHP. No shame." comment in the README. Honestly, I can't blame the original creators since the syntax/steam-api library seems to be the most mature that I've come across.

jdmcmahan commented 3 years ago

Do you have any idea what I'd have to ask them to set to get the non responsive steamIDs to return data? I'm getting data for a bunch of irregulars and all my regular attendees aren't returning data. I'm pretty sure I could ask most of them to change whatever it is about their profiles that's causing this, if I knew what it was..

Hmm, I'm not sure I fully understand the context. I do know a player's Steam profile can't be private in order for their games to be picked up by the APIs. Can you elaborate?

jdmcmahan commented 3 years ago

This might need the rate limiting treatment that this app has in other places.. After doing an entire file of these, I got the following error:

Client error: GET http://store.steampowered.com/api/appdetails/?appids=244070&key=REDACTED&format=json resulted in a 429 Too Many Requests response: null

Incidentally, do you have a ballpark estimate for the total number of apps (across all Steam IDs) you're queueing? AFAICT the store API is rate limited by the (calendar) day for a particular API key, so it's possible running the command several times with a ludicrous number of apps could use up the rate limit fairly quickly.

billthecatt commented 3 years ago

Incidentally, do you have a ballpark estimate for the total number of apps (across all Steam IDs) you're queueing?

user1@autofill:~/lancache-autofill$ wc -l steam64s.txt 33 steam64s.txt

So, 33 total steamIDs. These are 50/50 regular and irregular attendees who's steamIDs I could harvest out of the server logs from CsGo, tf2, etc etc.

jdmcmahan commented 3 years ago

Closing as duplicate of #58.

jdmcmahan commented 3 years ago

Wondering if we should just consider this a full blown fork and start making comments and opening issues on your own git?

@billthecatt FYI - I've cleaned up the upstream pull requests as well as the master branch in my fork. You should be able to clone https://github.com/jdmcmahan/lancache-autofill.git directly for all the latest goodies.

I've also enabled issues in my fork in case we start seeing more activity over there.