-
Notifications
You must be signed in to change notification settings - Fork 174
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
Stats in JSON format #686
Stats in JSON format #686
Conversation
Fixed code not entering the inital "Stats" section. Moved the section name extraction to avoid messing with the traversal stack.
} | ||
} | ||
|
||
public bool DumpToFilePath(const char[] path) { |
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.
A suggestion:
- Add a generic
IsJSONPath
function to util.sp - That implementation can be simplified doing something like:
StrCompare(path[path_length - 5], ".json") == 0
(after validating path_length > 5 still) - Replace this with a call to that function
- Make this function:
return IsJSONPath(path) : DumpToJSONFile(path) : g_StatsKv.ExportToFile(path);
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.
Implemented in a3e9d2b
} | ||
|
||
char jsonBuffer[8192]; // 8 KiB |
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.
I'm not sure how large the json data is in practice TBH, I'm wondering if 8KiB is enough; do you have a sense of the size for a normal 10-person 3-map match?
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.
This was a guess based on intuition. I tried 32 KiB but that crashed with a out of heap or stack space error (I don't recall which)
IsJSONPath checks if the path ends in ".json". Change DumpToFilePath and LoadMatchFile to use IsJSONPath.
Hi, sir I have just started this project about JSON match stats. If you are able to send match stats JSON body as a POST request to a server set with get5_match_stats_api_url that would be awesome! Erkut |
Add in global forwards. Update debug calls. Update misused sizeof. Include timer to make sure unpause event fires off. Having to create new timer to keep track of unpause event. Additional comments. Move team for when timer is finished. Include global handler for p;ause time. This is needed if users !pause during the match. Use freeze time, it works as intended. Fixes based on comments. Remove Handler. Bump to 0.8.0-dev, since splewis#612 will have breaking eventlogger changes. (Squashed): Added knife kills, utility damage and enemies/team-flash tracking (splewis#612) Use game-provided flash-assist logic Stats in JSON format (splewis#686) * Dump stats in JSON format * update sm-json * Fix malformed JSON stats Fixed code not entering the inital "Stats" section. Moved the section name extraction to avoid messing with the traversal stack. * Reduced JSON stats buffer to avoid "out of heap" errors * Add debug log when trying to JSON encode unsupported type * Only dump stats in JSON format if stats file have json extension * Util function for checking json extension IsJSONPath checks if the path ends in ".json". Change DumpToFilePath and LoadMatchFile to use IsJSONPath.
Add in global forwards. Update debug calls. Update misused sizeof. Include timer to make sure unpause event fires off. Having to create new timer to keep track of unpause event. Additional comments. Move team for when timer is finished. Include global handler for p;ause time. This is needed if users !pause during the match. Use freeze time, it works as intended. Fixes based on comments. Remove Handler. Bump to 0.8.0-dev, since splewis#612 will have breaking eventlogger changes. (Squashed): Added knife kills, utility damage and enemies/team-flash tracking (splewis#612) Use game-provided flash-assist logic Stats in JSON format (splewis#686) * Dump stats in JSON format * update sm-json * Fix malformed JSON stats Fixed code not entering the inital "Stats" section. Moved the section name extraction to avoid messing with the traversal stack. * Reduced JSON stats buffer to avoid "out of heap" errors * Add debug log when trying to JSON encode unsupported type * Only dump stats in JSON format if stats file have json extension * Util function for checking json extension IsJSONPath checks if the path ends in ".json". Change DumpToFilePath and LoadMatchFile to use IsJSONPath.
Add support for writing stats in JSON format.
The feature is enabled by setting the
get5_stats_path_format
cvar to a value ending in.json
The work is paid for in part by ehub.gg