You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void DejaVu::HandleForfeitChanged(std::string eventName)
{
LOG(INFO) << eventName;
ServerWrapper server = this->gameWrapper->GetCurrentGameState();
if (server.IsNull())
return;
if (server.GetbCanVoteToForfeit())
return;
// that means some team forfeited the game
GameOver();
}
Which works. Then it heads to GameOver(); -> which leads to SetRecord();
void DejaVu::SetRecord()
{
if (!IsInRealGame())
return;
auto server = this->gameWrapper->GetOnlineGame();
if (server.IsNull())
return;
auto winningTeam = server.GetWinningTeam();
if (winningTeam.IsNull())
return;
auto localPlayer = server.GetLocalPrimaryPlayer();
if (localPlayer.IsNull())
return;
auto localPRI = localPlayer.GetPRI();
if (localPRI.IsNull())
return;
PlaylistID playlist = static_cast<PlaylistID>(server.GetPlaylist().GetPlaylistId());
bool myTeamWon = winningTeam.GetTeamNum() == localPRI.GetTeamNum();
Log(myTeamWon ? "YOU WON!" : "YOU LOST!");
And here is the beginning of the related code.
My theory is that since Function TAGame.GameEvent_Soccar_TA.OnMatchWinnerSet (and related *GameWinnerSet functions) doesn't get called until the end of the game or match (like when the match is transitioning into the end screen), the value for the winningTeam doesn't get updated before this runs... (and it must be updated after goals get scored since the value will be equal to your team value if you're ahead in score (or else it would've been some default value) no matter what team you're on). In my testing, if you forfeit and the game immediately ends, then (I guess) the winner is set before SetRecord() is called, and it reports a loss as expected.
I would propose not caring about checking for forfeiting, if it's ultimately inconsequential, and the "GameOver" state is always, reliably reachable. Otherwise, I'd check for: while Function TAGame.GameEvent_TA.OnCanVoteForfeitChanged is still active (since it's set once when you can forfeit, and set again when you can't --- during a match), and Function TAGame.VoteActor_TA.EventStarted is called in that time (which, as far as I know means your team is forfeiting... since I think when you're able to forfeit, the only voting allowed to be done is forfeiting... unless I'm missing a corner case... I don't think there's anything else to vote on ... tangent: the only other things to vote on are while you're in the post-game screen, like rematch), until Function TAGame.VoteActor_TA.Passed would mean that the vote passed, and you would have your status set to LOST regardless.
addendum: Curiously, I went into 1s, went up 2-1, and while I could forfeit, I let the opponent score, and forfeited during the replay time... and I didn't see a corresponding match winning message.
my bakkesmod.log for when that happened:
[20:46:20] [bakkesmod] Adding GameStartTime:2024-06-28T20:46:20-0500 to the replay log
[20:46:20] [bakkesmod] Got MMR request for mu=41.2987, sigma=2.5, played=185 calculated result: 925.974
[20:46:20] [bakkesmod] Adding MMR:Steam|---|0:PRE:925.974|0|0 to the replay log
[20:46:20] [bakkesmod] [class BakkesModPlayground] Function ProjectX.GRI_X.PostBeginPlay WAS CALLED!
[20:46:21] [RankShowMod] New game event set
[20:46:21] [RankShowMod] New game event set
[20:46:21] [RankShowMod] Match ended 866356992
[20:46:21] [RankShowMod] Match ended2 -1
[20:46:21] [RankShowMod] New game event set
[20:46:21] [RankShowMod] Player can now leave
[20:46:24] [bakkesmod] [class BakkesModPlayground] Function ProjectX.GRI_X.EventGameStarted WAS CALLED!
[20:46:24] [bakkesmod] [class BakkesModPlayground] Function ProjectX.GRI_X.EventGameStarted WAS CALLED!
[20:46:24] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:46:28] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:46:50] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:46:54] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:46:54] [bakkesmod] [class BakkesModPlayground] Function ProjectX.GRI_X.EventGameStarted WAS CALLED!
[20:46:54] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:46:58] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:04] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:07] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:08] [bakkesmod] [class BakkesModPlayground] Function ProjectX.GRI_X.EventGameStarted WAS CALLED!
[20:47:08] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:12] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:27] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:30] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:31] [bakkesmod] [class BakkesModPlayground] Function ProjectX.GRI_X.EventGameStarted WAS CALLED!
[20:47:31] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:47:35] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:48:17] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:48:19] [bakkesmod] > bmp_try_to_forfeit
[20:48:21] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:48:31] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_TA.EventGameStateChanged WAS CALLED!
[20:48:31] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_Soccar_TA.EventMatchWinnerSet WAS CALLED!
[20:48:31] [RankShowMod] Match ended 866356992
[20:48:31] [RankShowMod] Match ended2 1
[20:48:31] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_Soccar_TA.EventGameWinnerSet WAS CALLED!
[20:48:31] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_Soccar_TA.OnMatchEnded WAS CALLED!
[20:48:31] [bakkesmod] [class BakkesModPlayground] Function TAGame.GameEvent_Soccar_TA.EventMatchEnded WAS CALLED!
[20:48:31] [bakkesmod] Adding GameEndTime:2024-06-28T20:48:31-0500 to the replay log
[20:48:31] [bakkesmod] Adding GameWinner:1 to the replay log
it seems here's the related section of the dejavu.log
2024-06-28 20:46:18,214 INFO [DejaVu.cpp:740] Function OnlineGameJoinGame_X.JoiningBase.IsJoiningGame
2024-06-28 20:46:20,284 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:20,291 INFO [DejaVu.cpp:740] Function TAGame.GameEvent_Soccar_TA.OnAllTeamsCreated
2024-06-28 20:46:24,251 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function GameEvent_TA.Countdown.BeginState
2024-06-28 20:46:24,251 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:588] Haven't processed yet: FrogPierce
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:593] Haven't met yet: FrogPierce
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:660] adding player: FrogPierce
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:679] player team num: 1
2024-06-28 20:46:24,252 INFO [DejaVu.cpp:433] WriteData
2024-06-28 20:46:31,181 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:32,209 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:33,195 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:34,189 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:35,195 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:36,181 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:37,182 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:38,211 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:39,182 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:40,210 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:41,196 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:42,183 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:43,183 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:44,197 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:45,196 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:46,203 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:47,204 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:48,190 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:49,183 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:50,183 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:46:50,546 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function TAGame.Team_TA.EventScoreUpdated
2024-06-28 20:46:50,546 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:46:50,546 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:46:50,546 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:46:54,330 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function GameEvent_TA.Countdown.BeginState
2024-06-28 20:46:54,330 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:46:54,330 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:46:54,330 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:47:01,211 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:02,204 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:03,224 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:04,204 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:04,379 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function TAGame.Team_TA.EventScoreUpdated
2024-06-28 20:47:04,379 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:47:04,379 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:47:04,379 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:47:08,429 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function GameEvent_TA.Countdown.BeginState
2024-06-28 20:47:08,429 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:47:08,429 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:47:08,429 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:47:15,791 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:16,804 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:17,791 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:18,811 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:19,784 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:20,791 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:21,792 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:22,791 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:23,778 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:24,820 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:25,792 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:26,799 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:27,412 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function TAGame.Team_TA.EventScoreUpdated
2024-06-28 20:47:27,412 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:47:27,412 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:47:27,412 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:47:31,210 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function GameEvent_TA.Countdown.BeginState
2024-06-28 20:47:31,210 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:47:31,210 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:47:31,210 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:47:37,556 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:38,548 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:39,555 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:40,549 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:41,562 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:42,556 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:43,550 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:44,542 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:45,542 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:46,556 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:47,549 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:48,550 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:49,571 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:50,557 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:51,557 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:52,571 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:53,544 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:54,551 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:55,543 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:56,572 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:57,564 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:58,543 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:47:59,572 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:00,558 INFO [DejaVu.cpp:756] Function TAGame.GameEvent_TA.OnCanVoteForfeitChanged
2024-06-28 20:48:00,558 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:01,551 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:02,558 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:03,565 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:04,559 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:05,565 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:06,545 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:07,559 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:08,559 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:09,553 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:10,552 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:11,552 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:12,545 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:13,559 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:14,548 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:15,554 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:16,557 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:17,516 INFO [DejaVu.cpp:500] HandlePlayerAdded: Function TAGame.Team_TA.EventScoreUpdated
2024-06-28 20:48:17,516 INFO [DejaVu.cpp:504] server is null: false
2024-06-28 20:48:17,516 INFO [DejaVu.cpp:512] Match GUID: 3C00113C11EF35B9F36D21BF95A970F4
2024-06-28 20:48:17,516 INFO [DejaVu.cpp:570] uniqueID: 81fba07ba5c14a9e81bf16a159bfd7fd name: FrogPierce
2024-06-28 20:48:19,462 INFO [DejaVu.cpp:756] Function TAGame.GameEvent_TA.OnCanVoteForfeitChanged
2024-06-28 20:48:19,462 INFO [DejaVu.cpp:433] WriteData
2024-06-28 20:48:31,113 INFO [DejaVu.cpp:749] Function TAGame.GameEvent_Soccar_TA.OnMatchWinnerSet
2024-06-28 20:48:31,116 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
2024-06-28 20:48:31,332 INFO [DejaVu.cpp:708] Function TAGame.GameEvent_TA.EventPlayerRemoved
2024-06-28 20:48:33,082 INFO [DejaVu.cpp:740] Function TAGame.GameEvent_Soccar_TA.InitGame
2024-06-28 20:48:33,325 INFO [DejaVu.cpp:740] Function TAGame.GameEvent_Soccar_TA.OnAllTeamsCreated
2024-06-28 20:48:33,325 INFO [DejaVu.cpp:773] Function TAGame.GameEvent_Soccar_TA.OnGameTimeUpdated
The text was updated successfully, but these errors were encountered:
this is unrelated, but I've been messing around with GetGameTimeRemaining, and it only seems to update/operate as expected when you're in a LAN match, freeplay, etc. So IsFinished() is the only thing doing anything here... Notably though, GetbOvertime() is set in an online match when you're in overtime.
I know that I added the forfeit handling for the case of forfeiting during a replay and then quiting, since that would prevent you from getting the game end screen. At least it seems like an odd case to catch forfeiting while winning.
It seems you're comfortable reading code, so if you're able to find a fix for both cases feel free to make a PR.
Problem:
If you're ahead in score in game, and you forfeit in a game state that doesn't immediately end the game, you are incorrectly declared the winner.
To reproduce:
a) You're able to forfeit
b) Scoring a goal or having a goal scored on you (when you're in the "Replay" state)
Result: "You won!" is printed instead of "You lost!"
I suspect it affects more than just 1s, it's just easiest to reproduce in 1s.
So, the related line is here which hooks
HandleForfeitChanged
which leads to this
Deja-Vu/DejaVu.cpp
Line 754 in 57387c8
Which works. Then it heads to
GameOver();
-> which leads toSetRecord();
And here is the beginning of the related code.
My theory is that since
Function TAGame.GameEvent_Soccar_TA.OnMatchWinnerSet
(and related *GameWinnerSet functions) doesn't get called until the end of the game or match (like when the match is transitioning into the end screen), the value for thewinningTeam
doesn't get updated before this runs... (and it must be updated after goals get scored since the value will be equal to your team value if you're ahead in score (or else it would've been some default value) no matter what team you're on). In my testing, if you forfeit and the game immediately ends, then (I guess) the winner is set beforeSetRecord()
is called, and it reports a loss as expected.I would propose not caring about checking for forfeiting, if it's ultimately inconsequential, and the "GameOver" state is always, reliably reachable. Otherwise, I'd check for: while
Function TAGame.GameEvent_TA.OnCanVoteForfeitChanged
is still active (since it's set once when you can forfeit, and set again when you can't --- during a match), andFunction TAGame.VoteActor_TA.EventStarted
is called in that time (which, as far as I know means your team is forfeiting... since I think when you're able to forfeit, the only voting allowed to be done is forfeiting... unless I'm missing a corner case... I don't think there's anything else to vote on ... tangent: the only other things to vote on are while you're in the post-game screen, like rematch), untilFunction TAGame.VoteActor_TA.Passed
would mean that the vote passed, and you would have your status set to LOST regardless.addendum: Curiously, I went into 1s, went up 2-1, and while I could forfeit, I let the opponent score, and forfeited during the replay time... and I didn't see a corresponding match winning message.
my bakkesmod.log for when that happened:
it seems here's the related section of the dejavu.log
The text was updated successfully, but these errors were encountered: