-
-
Notifications
You must be signed in to change notification settings - Fork 193
feat: Add Automatic Gamedata Updates #925
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
Conversation
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.
Pull Request Overview
Adds a new automatic gamedata update mechanism that checks a remote ETag and downloads an updated gamedata.json when needed.
- Introduces
TryUpdateGameConfig()in a new updater module to fetch and store gamedata based on ETag differences - Adds
AutoUpdateEnabledandAutoUpdateURLsettings to core config (native and managed) and example config - Updates build scripts (CMake and platform makefiles) to include OpenSSL and new updater source files
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mm_plugin.cpp | Invokes the updater when AutoUpdateEnabled is true |
| src/core/gameconfig_updater.h / cpp | New HTTP-based ETag checker and downloader for gamedata.json |
| src/core/coreconfig.h / coreconfig.cpp | Added AutoUpdateEnabled and AutoUpdateURL config fields |
| managed/CounterStrikeSharp.API/Core/CoreConfig.cs | Exposed new update settings in the managed CoreConfigData |
| makefiles/windows.base.cmake | Linked OpenSSL libraries for SSL support |
| makefiles/linux.base.cmake | Linked OpenSSL libraries for SSL support |
| CMakeLists.txt | Added OpenSSL find and listed updater headers & sources |
| configs/addons/.../core.example.json | Updated example JSON with new auto-update settings |
Comments suppressed due to low confidence (3)
src/core/gameconfig_updater.cpp:21
- [nitpick] The
@returntag is present but lacks a description. Please add a brief explanation of what the boolean return value indicates (e.g.,trueon success,falseon failure).
/// @return
src/core/gameconfig_updater.cpp:22
- [nitpick] Consider adding unit or integration tests for
TryUpdateGameConfig()to cover scenarios such as unchanged ETag, successful download, and various failure modes (network error, file I/O error).
bool TryUpdateGameConfig()
src/mm_plugin.cpp:125
- The call to
update::TryUpdateGameConfig()uses the unqualifiedupdatenamespace. The function is declared incounterstrikesharp::update, so either qualify the call (counterstrikesharp::update::TryUpdateGameConfig()) or add an appropriateusingdeclaration.
if (!update::TryUpdateGameConfig())
|
don't forget to update the docs page with the new core config entries |
Adds a basic automatic gamedata update system which will check the latest gamedata.json file from a CDN and download the new gamedata file if the ETag is different.
Gamedata updates can be completed through a PR to the CS2-Gamedata repo which will verify valid sigs and then sync with the CDN on merge.