-
Notifications
You must be signed in to change notification settings - Fork 6
Personal bests history #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Personal bests history #66
Conversation
|
I can't speak for the rest of the code, but I find it weird to only create the "unmonitored" key if the value is true and vice versa. Feels a lot simpler to include the value regardless and read the bool afterwards Same with doing |
|
I used I understand what you mean for unmonitored. The idea is to just flag unreliable records in the special case when the GrindingStats PB tracking is incomplete and the current public PB doesn't match the PBs known to the plugin -- including all the savefiles predating the feature. But JSON requires values for all keys... we could also use |
|
I maybe have an idea regarding the "unmonitored" issue that Fort raised — how would you feel about |
|
all uint64s should stored as strings due to the fact that the json implementation in OP abbreviates when it can into scientific notation (ie. 1.51e13) and this leads to a loss of accuracy. |
src/Components/PersonalBests.as
Outdated
| return Json::Write(toJson()); | ||
| } | ||
|
|
||
| void debug_print(string s) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void debug_print(string s) { | |
| void debug_print(const string &in s) { |
C:/users/steamuser/OpenplanetNext/Plugins/GrindingStats/src/Components/PersonalBests.as (148, 2) : WARN : Sanity check: Use 'const string &in s' to pass a string by reference (prefix the parameter name with an underscore to ignore this warning)
|
currently the handler routine is not stopping when i leave a map, im not sure why yet. |
|
Okay, I have implemented the changes discussed above.
I'm not sure I understand ; do you mean generally, or did you see that behavior with the PersonalBests handler specifically ? |
|
the personal bests handler in specific |
|
I see. I'll try to look into it. How could you tell it's not stopping ? |
|
in the debug menu of openplanet if you expand grinding stats you can see the list of all running coroutines |
|
Okay, this drove me nuts; I didn't take the problem by the right end and I mistakenly went down a rabbit hole of pointer shenanigans and why-isn't-my-destructor-called, but I've found the cause. Actually the The practical reason why all the other handlers do stop is because of the line For In fact, none of the hanlders stop if you don't return to the game menu. For instance if you're in a campaign and hit the "next" button (but presumably also if you're on a map-rotation server), all the hanlders of the earlier maps you've played are likely still running. They're not referenced in the active DataManager object though so they don't create data corruption. Actually while investigating the rogue instances last week, I was quite confused about |
|
hmm, yeah cleaning up the handlers should be a separate PR, and should be merged before this one |
|
i'd be happy to port these changes over to MP4 and TURBO after everything is how we want it |
Sounds good. I'll draft up a separate branch
That would be awesome :) I haven't played the previous games yet but it's really cool to see them live on despite tm2020 |
|
I added a I'll see what I can do for the handlers and I'll come back here afterwards |
Hello Drek! Here's my temptative implementation for #61 (saving stats at every PB).
What do you think? I'm new to Openplanet/TM plugins so I'm not sure that I haven't f**ked up somewhere. Let me know if my code is not understandable... It does what's proposed in the Issue tracker.
I've tested it on the Openplanet School maps and I made it work on my side, hopefully it will work right away for you too. You can uncomment
debug_print()in the new component if you want the logs.A few specific points :
Map_GetRecord_v2()when checking it after a finish. Then the new time is "discovered" only at the next finish, which is a decent issue in terms of functionality. I haven't really looked into it ; have you run into this problem before?Cheers,
Nico
p.s. here's a sample savefile: