You need to get a link file in .dem format by demo code (as an example code CSGO-OyjY3-pPKCF-cmpHJ-wdohh-CY5dK )

The necessary link looks like http://replay124.valve.net/730/003072985384448163905_0699089210.dem.bz2 , but get the values ​​by the demo code:

  1. 003072985384448163905
  2. 0699089210
  3. 124

I would like to do it in PHP, but it can be done on NodeJS, but I did not find anything on this topic on the Internet.

Up: In the demo game itself, you can download the csgo_download_match код демо from the internal console of the game with the csgo_download_match код демо eg csgo_download_match CSGO-pj5MV-zyzpa-PaHVb-tFUwV-HGXbD , but it’s still a mystery

  • I believe that all this is written in the documentation: partner.steamgames.com/documentation/api WebAPI: partner.steamgames.com/documentation/webapi - zhenyab
  • Why, the fact is that Steam does not have the necessary methods, but you can also implement it without the API, the game itself somehow gets the link, but how .. - Red Woolf
  • For this, there is an API in which all the logic of creating these links is implemented. Full API documentation is available after registration, as it says. - zhenyab
  • It’s not that, I’ve entered to read, I understand the documentation on integrating Steam into the games, but I’m not creating a game - Red Woolf
  • Most likely there is a request to the server Steam with this code, and in response to a link to the demo file. Snifay packages. See where the demo code comes from, who generates it. - WhereColdWindsBlow

3 answers 3

Your problem has already been solved, moreover, there is a library for nodejs https://www.npmjs.com/package/csgo And here is the code that decodes your code:

 var scDecoder = new csgo.SharecodeDecoder("CSGO-U6MWi-hYFWJ-opPwD-JciHm-qOijD"); console.log(scDecoder.decode()); 

Turnip has a more complete example, use it.

-

The in-game loader uses the CMsgGCCStrike15_v2_MatchListRequestFullGameInfo function from the internal library NetHook2.dll

UPD: Here is a method that uses these functions, even called https://github.com/joshuaferrara/node-csgo/blob/master/handlers/match.js#L77

  • Thanks for the answer, when decode you get this object { matchId: '3147867909473173539', outcomeId: '3147871371216814391',tokenId: '8483' } but what to do with these values? no matter how tried to substitute does not download the demo - Red Woolf
  • @Red Woolf look at examples of using the library, surely sites use it. - ReklatsMasters
  • Yes, the fact is that the sites use but the documentation of the norms is not found in general, only that on github and npmjs and more examples are not found - Red Woolf
  • I do this var Steam = require('steam'), steamClient = new Steam.SteamClient(), steamUser = new Steam.SteamUser(steamClient), steamGC = new Steam.SteamGameCoordinator(steamClient, 730), csgo = require('csgo'), CSGO = new csgo.CSGOClient(steamUser, steamGC, false); var scDecoder = new csgo.SharecodeDecoder("CSGO-OXDfo-2Lnfv-YFFhM-qhUfR-awkMC"); var ob = scDecoder.decode(); console.log(CSGO.requestGame(ob.matchId, ob.outcomeId, ob.tokenId)); var Steam = require('steam'), steamClient = new Steam.SteamClient(), steamUser = new Steam.SteamUser(steamClient), steamGC = new Steam.SteamGameCoordinator(steamClient, 730), csgo = require('csgo'), CSGO = new csgo.CSGOClient(steamUser, steamGC, false); var scDecoder = new csgo.SharecodeDecoder("CSGO-OXDfo-2Lnfv-YFFhM-qhUfR-awkMC"); var ob = scDecoder.decode(); console.log(CSGO.requestGame(ob.matchId, ob.outcomeId, ob.tokenId)); but returns null - Red Woolf
  • callback forgotten in CSGO.requestGame method - ReklatsMasters

You can see here (c #) The function generatematchlist https://github.com/akiver/CSGO-Demos-Manager/blob/04b44968a4d3c70664e1b3c85c93f5e68ca9a5d2/src/ViewModel/HomeViewModel.cs

  • Thanks for the answer, but I'm not booming in c #, the function (call) is there like GenerateMatchListFile, but from where it draws I don’t know - Red Woolf
  • one
    An interesting project did not check whether it works or not, but the method responsible for generating the URL does not exactly generatematchlist , it only returns a parameter for the condition. But the GetDemoListUrl() method seems to return exactly what we need (a list of current URLs) github.com/akiver/CSGO-Demos-Manager/blob/… In it, GetMatchListDataFilePath() forms the necessary patch - Vayas

Well, who asks questions like that ?! What kind of link you need to create? But, if, as I understand it, you need to give the file on a specific request, then something like when you did it a long time ago.

 if($_GET['code'] == 'CSGO-OyjY3-pPKCF-cmpHJ-wdohh-CY5dK') { Header("HTTP/1.1 200 OK"); Header("Connection: close"); Header("Content-Type: application/pdf"); Header("Accept-Ranges: bytes"); Header("Content-Disposition: Attachment; filename=new_filename.pdf"); Header("Content-Length: 50000"); readfile('test_file.pdf'); } 
  • one
    There is a game on Steam CS: GO. It records games on steam servers and in the latest games for each game there is a code by which you can download a demo or give a friend something to download and, using some algorithm, you can get a link (there are sites on which it is implemented but I don’t know how to implement it and ask - Red Woolf