Blizzard / s2client-proto

StarCraft II Client - protocol definitions used to communicate with StarCraft II.
MIT License
3.76k stars 430 forks source link

Windows tempDir does not seem to work correctly #102

Open skjb opened 6 years ago

skjb commented 6 years ago

I have a PySC2 script that creates a new game with a different map, plays, then repeats.

After around 100-120 games it crashes with the following error:

SC2APIProtocol.ResponseCreateGame.Error.InvalidMapData: 'temporary map 'C:\Users\Steven\AppData\Local\Temp\StarCraft II\TempLaunchMap.SC2Map' has invalid data.'

In https://github.com/deepmind/pysc2/blob/dev/pysc2/lib/sc_process.py#L66 it defines the tempDir as sc-* where is a unique ID, however all of the temp files are instead inside StarCraft II as per the error message. The `sc-` directories are created but are empty.

Inside the StarCraft II directory there are a series of TempKeyFrameP##, TempPortraitP## and TempWriteReplyP## directories, as well as a number of TempLaunchMap~##.SC2Map files. The numbering on the files goes from 00 to 99 and there is one with no number at all.

image

From my guess the number limit is reached and so the application crashes, maybe it is trying to copy the TempLaunchMap.SC2Map to a numbered file but can't, then it attempts to read the map and the data does not match the map it is expecting.

I have checked with @tewalds and in their Linux systems the sc-* directories are used correctly.