adamk33n3r / Deja-Vu

BakkesMod Plugin to track players
MIT License
6 stars 4 forks source link

Win/Loss Record Only Occasionally functional #8

Closed Kaiyotech closed 1 year ago

Kaiyotech commented 2 years ago

Not sure if I'm doing something wrong. When I get multiple plays with someone (2, 3, etc) I almost never get a functional win loss record. Very rarely it'll show 1:0 or 0:1, but it almost always just shows 0:0. I was just going to turn the function back off (there are more important things in the world for sure) but figured I'd ask.

This applies even to people who I've played with multiple times after turning on the record option.

I'm on EPIC, with an EPIC account. Let me know if there's some logs or troubleshooting I can help with.

adamk33n3r commented 2 years ago

Unfortunately the only way reliable way I can detect what team has won the game is when the screen transitions to the winner screen. This is by listening to the Function TAGame.GameEvent_Soccar_TA.EventMatchEnded event https://github.com/adamk33n3r/Deja-Vu/blob/master/DejaVu.cpp#L244. If you leave the game before that (like during a 0:00 goal that wins the game) then the api doesn't have a winner. There might be a way to detect when you leave a match before the match ended screen but after the game is officially over, I just wasn't able to work out how at the time. I don't have the time to work on this plugin at the moment, but I would definitely accept PRs from you or anyone who wants to fix it.

Kaiyotech commented 2 years ago

Unfortunately the only way reliable way I can detect what team has won the game is when the screen transitions to the winner screen. This is by listening to the Function TAGame.GameEvent_Soccar_TA.EventMatchEnded event https://github.com/adamk33n3r/Deja-Vu/blob/master/DejaVu.cpp#L244. If you leave the game before that (like during a 0:00 goal that wins the game) then the api doesn't have a winner. There might be a way to detect when you leave a match before the match ended screen but after the game is officially over, I just wasn't able to work out how at the time. I don't have the time to work on this plugin at the moment, but I would definitely accept PRs from you or anyone who wants to fix it.

I bet that's the issue, I think you nailed it. I often use my macro to leave immediately, I bet it's too fast. I'll take a look at contributing, see if I can come up with something. Thanks for the plugin, it's one of my favorites.

Perhaps if (timer=0) check winner, elsif(timer=0 and tied) set trigger on next goal score to pick winner? I'll take a look next week at work if I have time.

You're not the only plugin that struggles with the end of game (even psyonix can't get the play again working, or give rewards properly).

adamk33n3r commented 2 years ago

Perhaps if (timer=0) check winner, elsif(timer=0 and tied) set trigger on next goal score to pick winner? That sounds good in theory, but at least when I was working on this issue before, the code that checks who won server.GetWinningTeam() was returning null until after that event fired. Maybe I was doing something wrong, or maybe it's better now. So I'd start there. If you can get server.GetWinningTeam() to return the correct winner earlier, then I think that'd solve the issue. And of course, you'd have to have something that "listens" for when the timer hits 0.

Anyway, cool. Looking forward to seeing what you find!