pysc2 icon indicating copy to clipboard operation
pysc2 copied to clipboard

bin/play.py --replay should accept urls

Open tewalds opened this issue 6 years ago • 2 comments

bin/play.py will replay a replay file, but only from local disk. It'd be nice if it was given a url it'd download it to memory and pass the data to the game without having to write it to disk somewhere.

tewalds avatar Jan 10 '18 17:01 tewalds

I like this idea! I would like to undertake developing this feature.

Pooch11 avatar Oct 02 '18 04:10 Pooch11

After researching this feature a little I stumbled upon this replay reader . Getting replay data from a URL seems trivial, I got that much working - however I am a little stumped on how to pass this memory correctly to SC2Client since we don't want to write it to disk. At the same time we probably want to avoid adding a huge parsing solution to the project. I'm not sure if I should be; Looking for some way to parse data in memory as a specific file type. (.SC2Replay) OR Looking for an injection point in SC2 client after it resolves the file name and starts reading the bytes just to give it the start location of bytes -perhaps I can give it a dummy file to run but 'point' it to another location in memory?

I also read somewhere that they are MPQ. Currently, I am going through the sc2Reader and Blizzard's s2protocol repos to look for hints or ideas.

Can anyone with experience in this point me towards more resources or documentation that exposes how blizzard executes their replays? I will keep looking through these repos, but python is a language that I am still getting adjusted to, so it will take some time.

Pooch11 avatar Oct 04 '18 12:10 Pooch11