timraay / HLLLogUtilities

A Discord bot that makes it easy to capture and export logs from your HLL servers
MIT License
8 stars 4 forks source link

Player Score update missing when players seem to disconnect when match ends #38

Closed FlorianSW closed 4 months ago

FlorianSW commented 4 months ago

I'm not quite sure if this is an issue with HLU tbh, however, I wanted to report it here nonetheless. I didn't have the time to look into this issue any further right now.

Consider the following csv exported log (I omit some of the player score update messages as they are not relevant):

11:44:11 - Sun, May 05  CHAT[Axis][NEGAT]       SLEYonator: gg (7656...)
11:44:13 - Sun, May 05  TEAM SWITCHED           ReasoN (7656....): Axis -> None
11:44:13 - Sun, May 05  TEAM SWITCHED           Nerø (7656...): Axis -> None
11:44:13 - Sun, May 05  TEAM SWITCHED           Gяey (7656...): Axis -> None
11:44:13 - Sun, May 05  UNIT SWITCHED           ReasoN (Axis/7656...): HOW -> None
11:44:13 - Sun, May 05  UNIT SWITCHED           Nerø (Axis/7656...): QUEEN -> None
11:44:13 - Sun, May 05  UNIT SWITCHED           Gяey (Axis/7656...): OPTION -> None
11:44:13 - Sun, May 05  CHAT[Axis][NEGAT]       PressF: hill innit (7656...)
11:44:13 - Sun, May 05  MATCH ENDED             MATCH ENDED `HILL 400 WARFARE` ALLIED (2 - 3) AXIS
11:44:13 - Sun, May 05  PLAYER SCORE            Bleicher Junge (7656...): 246 C, 520 O, 740 D, 1126 S (KD: 35/59)
11:44:13 - Sun, May 05  PLAYER SCORE            유 Mike Lawry (7656...): 780 C, 680 O, 440 D, 0 S (KD: 97/79)
// a lot more PLAYER SCORE mesasges
11:44:13 - Sun, May 05  DISCONNECTED            ReasoN (7656...)
11:44:13 - Sun, May 05  DISCONNECTED            Nerø (7656...)
11:44:13 - Sun, May 05  DISCONNECTED            Gяey (7656...)
11:44:16 - Sun, May 05  CHAT[Allies][SUGAR]     GBI • SWEET: gg (7656...)

The players Nerø (7656...), Gяey (7656...) and ReasoN (Axis/7656...) do not appear in the PLAYER SCORE update block and the whole logs do not contain any player score mesasge for these players. I would have expected to have a player score for them as well. The only similarity of them is that they are all disconnected at the same time when the match ended (from the point of view of the logs). Not sure if that is the issue or just a coincidence. All other players mentioned in the logs have a player score, though.

timraay commented 4 months ago

PLAYER SCORE logs are invoked in two ways;

The only similarity of them is that they are all disconnected at the same time when the match ended (from the point of view of the logs). Not sure if that is the issue or just a coincidence.

This makes a lot of sense if you consider that HLU collects events and processes them at intervals. If a player leaves within the same interval the server transitions into a new state, neither of the two conditions will be met.

timraay commented 4 months ago

I assumed that upon a player disconnecting I was retrieving the most up-to-date server state and that I could simply change it to use the state that the server had at the time the player was last seen, which would make this a super easy fix. But this already seems to be the case? I feel like I must be missing something here.

timraay commented 4 months ago

Found the issue. Since both cases are computed in different places, if both places would try to add player_score_update events in the same interval, it would discard one of them, under the assumption that they were duplicates.

FlorianSW commented 4 months ago

Awesome,t hanks a lot! :)