Updated update offsets script, to properly fetch game version from the info json
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
+1
Submodule src/external/AsyncLogger added at 25b5ed31b3
+1
Submodule src/external/curl added at 217f0e4d59
+1
Submodule src/external/imgui added at 1d942eb6c9
+1
Submodule src/external/json added at af524ab666
Reference in New Issue
Block a user