From 667f193a2d29748b779caff871ea0a41fd38dd70 Mon Sep 17 00:00:00 2001 From: IMXNOOBX <69653071+IMXNOOBX@users.noreply.github.com> Date: Fri, 20 Oct 2023 21:17:29 +0200 Subject: [PATCH 1/3] Update update_offsets.py --- offsets/update_offsets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index a426f08..e1136df 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -28,12 +28,12 @@ if dest_data["build_number"] == int(build_number): dest_data["build_number"] = int(build_number) -dest_data["dwBuildNumber"] = source_data["Engine2Dll"]["dwBuildNumber"] -dest_data["dwLocalPlayer"] = source_data["ClientDll"]["dwLocalPlayerPawn"] -dest_data["dwEntityList"] = source_data["ClientDll"]["dwEntityList"] -dest_data["dwViewMatrix"] = source_data["ClientDll"]["dwViewMatrix"] +dest_data["dwBuildNumber"] = source_data["Engine2Dll"]["dwBuildNumber"]["value"] +dest_data["dwLocalPlayer"] = source_data["ClientDll"]["dwLocalPlayerPawn"]["value"] +dest_data["dwEntityList"] = source_data["ClientDll"]["dwEntityList"]["value"] +dest_data["dwViewMatrix"] = source_data["ClientDll"]["dwViewMatrix"]["value"] with open(dest_path, 'w') as dest_file: json.dump(dest_data, dest_file, indent=4) -print("Offsets updated in the local file.") # We dont exit so we know that the game has been updated and that we have to commit the new offsets \ No newline at end of file +print("Offsets updated in the local file.") # We dont exit so we know that the game has been updated and that we have to commit the new offsets From acb52256ec8b1775485fde8f2a03be0c66158af8 Mon Sep 17 00:00:00 2001 From: IMXNOOBX <69653071+IMXNOOBX@users.noreply.github.com> Date: Fri, 20 Oct 2023 21:27:08 +0200 Subject: [PATCH 2/3] Update update_offsets.py --- offsets/update_offsets.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index e1136df..7184a2f 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -16,8 +16,12 @@ build_number = 0 if response.status_code == 200: commit_data = response.json() if commit_data: - last_commit_message = commit_data[0]['commit']['message'] - build_number = last_commit_message.split()[-1] + for commit in commit_data: + commit_message = commit['commit']['message'] + build_match = re.search(r'\bGame Update (\d+)(?: \(\d+\))?\b', commit_message) + if build_match: + build_number = int(build_match.group(1)) + break with open(dest_path, 'r') as dest_file: dest_data = json.load(dest_file) From f44a4099e6acac921a52c2a91ec0bc124e9260cd Mon Sep 17 00:00:00 2001 From: IMXNOOBX <69653071+IMXNOOBX@users.noreply.github.com> Date: Fri, 20 Oct 2023 22:39:26 +0200 Subject: [PATCH 3/3] Update update_offsets.py --- offsets/update_offsets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index 7184a2f..bae1aa3 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -1,6 +1,7 @@ import sys import requests import json +import re source_url = "https://github.com/a2x/cs2-dumper/raw/main/generated/offsets.json" commits_url = "https://api.github.com/repos/a2x/cs2-dumper/commits"