StatsHelix / demoinfo

A library to analyze CS:GO demos in C#
MIT License
322 stars 78 forks source link

Fix or Walkaround on parser for third party platforms #146

Open thiagohrm opened 6 years ago

thiagohrm commented 6 years ago

Hello folks I’m new here and I’m using a tool made to create vdm files from demos and the tool uses this parser to get the steamaiD of the players But the parser doesn’t recognize all the IDs of the players from demos of the third party plataforms like esea faceit or ebot But grab all the IDs from valves demo (MM and Majors)

Someone know any walk around or way to try get these ID ?

0BuRner commented 6 years ago

Hello, what's the tool name? I guess it's a bug in the tool and not in the parser since SteamIDs retrieving is independent of the bot managing the record of the demo. (If I remember correctly)

thiagohrm commented 6 years ago

This is the tool https://github.com/Citizen01/csgo-overwatch-vdm

The tool parse the full demo from header to end , but retrieve just some ids , but when asked to scan valve dem it got all of them

moritzuehling commented 6 years ago

What does the code for extraction look like?

thiagohrm commented 6 years ago

this is the method

image

    private static void PrintSteamIdList(string fileName)
    {
        using (var fileStream = File.OpenRead(fileName))
        {
            Console.WriteLine("==== List of the steamids of the players ====");
            using (var parser = new DemoParser(fileStream))
            {
                parser.ParseHeader();
                parser.ParseToEnd();
                foreach (var player in parser.PlayingParticipants)
                {
                    Console.WriteLine(" - {0}  {1}", player.SteamID, player.Name);
                }
            }
        }
    }
moritzuehling commented 6 years ago

A player may disconnect before the demo is over. PlayingParticipants only returns the players that are connected to the server at that specific time. My recommendation is to check for the players at different times in the demo, by either parsing tick-By-tick or subscribing to an event, for example FreezeEnd.

This doesn't require a "fix" or "workaround", but is intended behaviour, as most properties such as "Position" or "Health" only apply to a single point in time.