dethredic / WC3StreamerOverlay

A simple tool for wc3 streamers to display their opponent's race and stats
GNU General Public License v3.0
30 stars 7 forks source link

faulty player display in 0.4.2 #7

Open ana-ka opened 5 years ago

ana-ka commented 5 years ago

In an arranged team game the tool failed to properly detect (or rather display) one player of the opponent team.

See an example. Note that the VOD will be automatically deleted after a few days. No idea what caused it - maybe the tool crashed since there was no overlay in subsequent games. I only noticed afterwards and I cannot positively tell if I somehow closed it in between, though I suspect I did not.

If there is any info I can give you, let me know. There doesn't seem to be logs. Also while we are at team games and I don't want to spam your issue section: I'd think that for AT the team stats for that particular team would be more useful than RT stats. :)

dethredic commented 5 years ago

What do you mean by no logs? There should be something printed in the console window, or did the console window close? It is very possible that the tool crashed. I can't do much without logs unfortunately, so please post if this happens again.

I added team support pretty quickly without thinking about the requirements too much. I guess the best thing to do would be check if you and your teammate have AT stats, and pull those, otherwise pull RT stats.

EDIT: In the future I think if you clip something from twitch it will stick around longer

ana-ka commented 5 years ago

What do you mean by no logs? There should be something printed in the console window, or did the console window close?

Well, no persistent logs anyway. If you close the console window, it is gone. And if you start the tool by double clicking and it crashes, the window would close automatically. But yea, I can't tell what happened. Eventhough my ally told me during the game, I cannot recall if there was a console window still open. Some (optional) logfile would be helpful in all those cases. I'll keep my eyes peeled.

Edit: It happened again. Again in an AT game. See here.

This time I got the full console output but there is nothing spectacular in it.

Initialized Client connected Setting gateway: Northrend Game started [1] ana-ka (Night Elf) - Solo: W:69 L:58 (54%) - Team: W:0 L:0 (0%) - FFA: W:0 L:0 (0%) [2] Lam (Random) - Solo: W:39 L:40 (49%) - Team: W:0 L:0 (0%) - FFA: W:0 L:0 (0%) Game ended Setting gateway: Northrend Game started [1] wanttodisappear (Night Elf) - Solo: W:53 L:49 (51%) - Team: W:0 L:0 (0%) - FFA: W:0 L:0 (0%) [2] cH1LLeR (Orc) - Solo: W:7 L:1 (87%) - Team: W:45 L:29 (60%) - FFA: W:0 L:0 (0%) [3] Work_Work (Random) - Solo: W:298 L:58 (83%) - Team: W:59 L:19 (75%) - FFA: W:0 L:0 (0%) Game ended ...

and finally a

Client disconnected

at the very end.

dethredic commented 5 years ago

Thanks for following up. Those logs narrow it down, but unfortunately don't give me enough to fix it. It looks like there was no crash, and it seemed to work again next game. My best guess based on your most recent report is either: 1) I'm not parsing the packet correctly 2) Occasionally bnet is packaging the player information differently for AT games

Note: if you want to redirect the output to a file, you can do so by opening a console window and running: WC3StreamerOverlay.exe >> output.txt 2>&1

ana-ka commented 5 years ago

I am aware of the packet documentation and might have a look for myself if I can find any obvious flaws (unlikely). Since its not practical to capture the entire traffic, maybe its feasible to dump a few packets after a "game started" to see whats going on. Anyhow...keep up the good work. If I find anything useful, I'll report back.

dethredic commented 5 years ago

Two things: 1) I pushed a new branch: better_at_support. This should hopefully show AT stats when applicable instead of RT stats. If you are comfortable running this from source and using git please try it out. 2) To diagnose the "missing player" issue, we can try to following diff to see if the parsing is failing, or if we just aren't getting the expected data:

diff --git a/src/bnet_player_monitor.py b/src/bnet_player_monitor.py
index a9175a6..2e1b316 100644
--- a/src/bnet_player_monitor.py
+++ b/src/bnet_player_monitor.py
@@ -57,6 +57,7 @@ class BNetPlayerMonitor(Thread):
       BNetStatsScraper.get_stats(player, self.gateway)
       self.player_list.append(player)
     elif raw_payload[:2] == b'\xf7\x06':
+      print(raw_payload)
       player_offset = 0
       while player_offset is not -1:
         player = Player()

If you have any questions, feel free to add me on discord: dethredic#1914

ana-ka commented 5 years ago

I won't be able to test anything before beginning/mid of next week at the earliest. I will report back when I did, but it might take a while. Meanwhile thanks for your efforts.