Skip to content

Conversation

@roflmuffin
Copy link
Owner

@roflmuffin roflmuffin commented Jul 9, 2025

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.

@roflmuffin roflmuffin requested a review from Copilot July 9, 2025 11:34
Copy link

Copilot AI left a 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 AutoUpdateEnabled and AutoUpdateURL settings 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 @return tag is present but lacks a description. Please add a brief explanation of what the boolean return value indicates (e.g., true on success, false on 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 unqualified update namespace. The function is declared in counterstrikesharp::update, so either qualify the call (counterstrikesharp::update::TryUpdateGameConfig()) or add an appropriate using declaration.
        if (!update::TryUpdateGameConfig())

@KillStr3aK
Copy link
Contributor

don't forget to update the docs page with the new core config entries

@roflmuffin roflmuffin merged commit 8ab61b0 into main Jul 9, 2025
6 checks passed
@roflmuffin roflmuffin deleted the feature/gamedata-autoupdate branch July 9, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants