1

Closed

Fix for the name of the Map

description

Hey! This last version is not working in some maps... I just saw whats the problem. Some maps like Desert Oasis and Steppes of War for example, dont have the string length before the proper data (dunno why).Lost temple do (dont know why), but some of them dont. I made some change here, its not so beautiful, but I tested in 16 replays mines with different maps and seems to work so far!!What I made was to try to find a pattern that all .sc2reps follow, and that 5 null bytes that you searched, have in all reps... After that, just search for the first A-Z caracter (30-60), and after that reads until 0x00!!// Your Code..... long pos = SeekSequence(bReplayInfo, ms.Position, new byte[] { 0x73, 0x32, 0x6d, 0x61 }, 6); ms.Seek(pos, SeekOrigin.Begin); reader.ReadBytes(10); pos = SeekSequence(bReplayInfo, ms.Position, new byte[] { 0x0, 0x0, 0x0, 0x0, 0x0 }); ms.Seek(pos, SeekOrigin.Begin);// Your Code.....// MyCode.....(made to read the map proprely) while (reader.PeekChar() < 30) reader.ReadByte(); ms.Position--; string mapName = ""; while (reader.PeekChar() != 0x0) mapName += reader.ReadChar();// MyCode..... //And continues with you code .... //string mapName = new string(reader.ReadString().ToCharArray()); Map = new MapInfo { Name = mapName, Thumbnail = image }; / pos = SeekSequence(bReplayInfo, ms.Position, new byte[] { 0x0, 0x10, 0x0, 0x0, 0x0 }); ms.Seek(pos, SeekOrigin.Begin); / // Skip the header reader.ReadBytes(5);
Closed Apr 9, 2010 at 6:57 PM by Kralizek
Fixed in Set 45625

comments