From e0cfb65964ccd39844a43de9d113b7772650c974 Mon Sep 17 00:00:00 2001 From: IMXNOOBX <69653071+IMXNOOBX@users.noreply.github.com> Date: Wed, 26 Nov 2025 18:43:26 +0100 Subject: [PATCH] Updated update offsets script, to properly fetch game version from the info json --- .gitignore | 3 ++- offsets/update_offsets.py | 23 +++++++++-------------- src/external/AsyncLogger | 1 + src/external/curl | 1 + src/external/imgui | 1 + src/external/json | 1 + 6 files changed, 15 insertions(+), 15 deletions(-) create mode 160000 src/external/AsyncLogger create mode 160000 src/external/curl create mode 160000 src/external/imgui create mode 160000 src/external/json diff --git a/.gitignore b/.gitignore index 5ab226f..19aad61 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,9 @@ # Ignore all the offsets.json files but the one in the folder offsets for the auto updater offsets.json config.json -!offsets/offsets.json typos +!offsets/offsets.json +.vscode # User-specific files *.rsuser diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index ff0cc0b..c19b84f 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -1,25 +1,20 @@ -import sys -import requests -import json -import re import os +import json +import requests urls = { - "commits": "https://api.github.com/repos/a2x/cs2-dumper/commits", - "offsets": "https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.json", + "info": "https://github.com/a2x/cs2-dumper/raw/refs/heads/main/output/info.json", + "offsets": "https://github.com/a2x/cs2-dumper/raw/refs/heads/main/output/offsets.json", "client_dll": "https://github.com/a2x/cs2-dumper/raw/refs/heads/main/output/client_dll.json", } def get_build_number(): - response = requests.get(urls["commits"]) + response = requests.get(urls["info"]) if response.status_code == 200: - commit_data = response.json() - if commit_data: - for commit in commit_data: - commit_message = commit['commit']['message'] - build_match = re.search(r'\bGame [Uu]pdate \((\d+)(?: \(\d+\))?\b', commit_message) - if build_match: - return int(build_match.group(1)) + game_info = response.json() + if game_info: + version = game_info['build_number'] + return int(version) return 0 def get_raw_file(url): diff --git a/src/external/AsyncLogger b/src/external/AsyncLogger new file mode 160000 index 0000000..25b5ed3 --- /dev/null +++ b/src/external/AsyncLogger @@ -0,0 +1 @@ +Subproject commit 25b5ed31b33c40fabc6b80213c330a10cccf3b49 diff --git a/src/external/curl b/src/external/curl new file mode 160000 index 0000000..217f0e4 --- /dev/null +++ b/src/external/curl @@ -0,0 +1 @@ +Subproject commit 217f0e4d59717fa2a9fd428a4e7458dde26e6e94 diff --git a/src/external/imgui b/src/external/imgui new file mode 160000 index 0000000..1d942eb --- /dev/null +++ b/src/external/imgui @@ -0,0 +1 @@ +Subproject commit 1d942eb6c9ef0b68cd1515df083d06da651b0d61 diff --git a/src/external/json b/src/external/json new file mode 160000 index 0000000..af524ab --- /dev/null +++ b/src/external/json @@ -0,0 +1 @@ +Subproject commit af524ab666359f09a16bca1a41543a9a3a941251