Closed Geekid812 closed 1 year ago
Update: looking for people who can reproduce this issue, or any issue regarding a time that is not submitted as a claim when it should! please let me know the circumstances under which this bug happens in this issue :eyes:
WRT the circumstances under which it happens, I suspect it's because of how you access the ghost, here: https://github.com/Geekid812/TrackmaniaBingo/blob/3a5de0ccd1e8d4f4c1745c89cc83b70be7db847d/src/play.as#L70
An alternate way (how TTG does it) is to track the number of ghosts, and then when a finish is detected, wait for the number of ghosts to increase and then get the most recent ghost's time.
Additional info and explanation:
app.Network.ClientManiaAppPlayground.DataFileMgr.Ghosts
app.PlaygroundScript.DataFileMgr.Ghosts
(new ghosts also appear here, but are removed again later).In both cases, record ghosts get loaded into app.Network.ClientManiaAppPlayground.DataFileMgr.Ghosts
.
So you need to either check the nickname on the ghost, or just tolerate that there's a tiny race condition where someone could load a record ghost at the exact moment they finish or something like that.
My suspicion is that PlaygroundScript.Ghost_RetrieveFromPlayer
is acting like a server would, which will return the best ghost for that player. You could test this by getting e.g., a 20s run, checking the time returned, then getting a 30s run, and checking the time returned (my prediction is that it'll be 20s not 30s).
This sort of bug would only matter if ppl already had a PB on the map -- and if the PB ghost loaded, which doesn't seem to always happen. Once they get a time, the best ghost isn't their new ghost, it's their PB.
Also, I am not exactly sure what Ghost_RetrieveFromPlayer
actually does. It sounds like something a server could do to ask the client to send their ghost. That could mb load the PB ghost if it isn't already. Additionally, ghosts sometimes aren't populated immediately (this is particularly noticeable on a server), so it's possible that you would have pulled the right ghost if you requested it a frame or two later. I haven't noticed this in local play, but I have run into a handful of weird bugs that occur only with high FPS. So it might be possible that the combination of all these things together are responsible for the bug.
For some reason. let's try and find out why