Updated update offsets script, to properly fetch game version from the info json

This commit is contained in:
IMXNOOBX
2025-11-26 18:43:26 +01:00
parent 8302541d1a
commit e0cfb65964
6 changed files with 15 additions and 15 deletions
+2 -1
View File
@@ -6,8 +6,9 @@
# Ignore all the offsets.json files but the one in the folder offsets for the auto updater # Ignore all the offsets.json files but the one in the folder offsets for the auto updater
offsets.json offsets.json
config.json config.json
!offsets/offsets.json
typos typos
!offsets/offsets.json
.vscode
# User-specific files # User-specific files
*.rsuser *.rsuser
+9 -14
View File
@@ -1,25 +1,20 @@
import sys
import requests
import json
import re
import os import os
import json
import requests
urls = { urls = {
"commits": "https://api.github.com/repos/a2x/cs2-dumper/commits", "info": "https://github.com/a2x/cs2-dumper/raw/refs/heads/main/output/info.json",
"offsets": "https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.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", "client_dll": "https://github.com/a2x/cs2-dumper/raw/refs/heads/main/output/client_dll.json",
} }
def get_build_number(): def get_build_number():
response = requests.get(urls["commits"]) response = requests.get(urls["info"])
if response.status_code == 200: if response.status_code == 200:
commit_data = response.json() game_info = response.json()
if commit_data: if game_info:
for commit in commit_data: version = game_info['build_number']
commit_message = commit['commit']['message'] return int(version)
build_match = re.search(r'\bGame [Uu]pdate \((\d+)(?: \(\d+\))?\b', commit_message)
if build_match:
return int(build_match.group(1))
return 0 return 0
def get_raw_file(url): def get_raw_file(url):
Vendored Submodule
+1
Submodule src/external/AsyncLogger added at 25b5ed31b3
Vendored Submodule
+1
Submodule src/external/curl added at 217f0e4d59
Vendored Submodule
+1
Submodule src/external/imgui added at 1d942eb6c9
Vendored Submodule
+1
Submodule src/external/json added at af524ab666