Crestwave / dst-misc

Misc stuff for the game Don't Starve Together
MIT License
0 stars 1 forks source link

dst daily gift #3

Closed bakustarver closed 1 month ago

bakustarver commented 1 month ago

is it possible to open dst daily gifts using curl?

Crestwave commented 1 month ago

Good question! This should be possible, although it would require interacting with the Steamworks API to generate tickets for login, as I believe it requires a client session token.

bakustarver commented 1 month ago

./daily.sh: 8: ./verify.sh: not found % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 158 100 52 100 106 70 144 --:--:-- --:--:-- --:--:-- 215 ERROR

Crestwave commented 1 month ago

You can just comment out that if statement for now.

bakustarver commented 1 month ago

Thank you, everything works

I found that it is possible to download drops.json without steam using browser cookies you need to find the session id for this

-- curl 'https://accounts.klei.com/account/transactions/drops.json' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0' -H 'Accept: application/json, text/plain, /' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Referer: https://accounts.klei.com/account/transactions' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Cookie: lang=en; session=yoursessionid' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Sec-GPC: 1' -H 'TE: trailers' get cookies from this site https://accounts.klei.com/account/transactions

can you guide how to get curl requests in dst or other programs?

Crestwave commented 1 month ago

I found that it is possible to download drops.json without steam using browser cookies you need to find the session id for this

Yes, of course, it's part of Klei's normal tranasctions page. I just automated it because I didn't like having to keep logging back in every now and then. :P

Similarly, you can extract the auth token from the game client instead of generating it yourself by running print(TheFrontEnd:GetAccountManager():GetToken()) from the in-game console (note that it expires after an hour of inactivity).

can you guide how to get curl requests in dst or other programs?

For applications like DST which respect the https_proxy environmental variable, you can just run a proxy server and point the env var to it to intercept the requests and analyze them.

bakustarver commented 1 month ago

Yes, I found the fiddler-everywhere program and was able to see the requests, also found posting DST/TICK, pity that other games don't show traffic like dst as well with https_proxy env variable

Crestwave commented 4 weeks ago

pity that other games don't show traffic like dst as well with https_proxy env variable

You can still force them to a proxy, it's just not as convenient. It's also very likely that they might be communicating in other protocols, in which case you can use Wireshark or something similar instead.

bakustarver commented 3 weeks ago

I'm a novice at this stuff, thanks for the advice, it's really helpful.