saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2 and Valve's Deadlock, written in C#.
MIT License
111 stars 10 forks source link

Events not firing for player who was initially disconnected #15

Closed jotalanusse closed 1 year ago

jotalanusse commented 1 year ago

I'm attempting to load a demo file depicting a scenario where a player is initially disconnected. Prior to the start of the first round, the previously missing player eventually connects.

However, when attempting to display the names of the spawning players, the player who was initially absent does not seem to be included in the recorded events of the game demo.

Example code used:

demo.Source1GameEvents.PlayerSpawn += e =>
{
    if (e.Player != null)
    {
        Console.WriteLine($"Player spawn: {e.Player.SteamID} | {e.Player.PlayerName}");
    }
};

demo.Source1GameEvents.RoundEnd += e =>
{
    Console.Write("\n");
};

The expected output from the previous code should be of a list containing 9 players for each round played. This list should reflect the absence of the player who was initially disconnected.

I'm in WinForms using version NET version .NET 7.0.

I'm leaving a link to the file used here.

EDIT:

Player death events don't seem to be working for the initially disconnected player either:

demo.Source1GameEvents.PlayerDeath += e =>
{
    if (e.Player != null)
    {
        Console.WriteLine($"Player death: {e.Player.SteamID} | {e.Player.PlayerName}");
    }
};

Maybe all events are not working for this player?

saul commented 1 year ago

This is very likely due to POV demos not being supported fully yet.

You're best off using server-side recorded demos, using tv_record.

jotalanusse commented 1 year ago

I'm aware that client recorded demos are not supported at the moment. So every demo I’ve been using are the ones downloaded direclty from Steam CSTV / GOTV by going to https://steamcommunity.com/id/MY_STEAM_ID/gcpd/730?tab=matchhistorypremier, and downloading them from there.

All the demos listed there should be from the server perspective, am I right?

saul commented 1 year ago

Apologies you're right.

The issue was with stringtable updates sometimes being off by one. This is now resolved in v0.2.8

Thanks for reporting

jotalanusse commented 1 year ago

Glad to help!