Skip to content

Commit

Permalink
1.2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed Jun 19, 2023
1 parent 34ccc69 commit 1e9a1ca
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 98 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
### 1.2.0 - June 18, 2023

- add support for GTA The Trilogy - The Definitive Edition v1.0.17.39540 (Epic Games Store)
- fix an issue when constructor commands for derived classes returned incorrect values (`Heli.Create`, `Boat.Create`, etc.)
- fix an issue when the library could not read the host version if the path to the executable contained non-ASCII characters
- improve log for objects: now it gets serialized with all properties, not just `[object Object]`

**INSTALLER**

- update references to Ultimate ASI Loader files to match their new names on GitHub
- append `Gameface\Binary\Win64` if a root directory of GTA The Trilogy - The Definitive Edition is selected

**SDK AND PLUGINS**

- Events 1.1: add support for latest version of GTA The Trilogy - The Definitive Edition (v1.0.17.39540), all launchers

**BREAKING CHANGES**

- bumped minimum required versions of [command definitions](https://re.cleo.li/docs/en/definitions.html)

### 1.1.3 - February 21, 2023

- add support for GTA The Trilogy - The Definitive Edition v1.0.17.39540 (Rockstar Games Launcher)
Expand Down
10 changes: 5 additions & 5 deletions docs/en/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ At start CLEO validates that a definition file is present and correct and if not

| Game | File | Minimum Required Version |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------ |
| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.262` |
| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.268` |
| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.313` |
| GTA III, re3 | [gta3.json](https://github.com/sannybuilder/library/blob/master/gta3/gta3.json) | `0.265` |
| GTA VC, reVC | [vc.json](https://github.com/sannybuilder/library/blob/master/vc/vc.json) | `0.271` |
| GTA San Andreas (Classic) 1.0 | [sa.json](https://github.com/sannybuilder/library/blob/master/sa/sa.json) | `0.316` |
| GTA III: The Definitive Edition | [gta3_unreal.json](https://github.com/sannybuilder/library/blob/master/gta3_unreal/gta3_unreal.json) | `0.227` |
| Vice City: The Definitive Edition | [vc_unreal.json](https://github.com/sannybuilder/library/blob/master/vc_unreal/vc_unreal.json) | `0.233` |
| San Andreas: The Definitive Edition | [sa_unreal.json](https://github.com/sannybuilder/library/blob/master/sa_unreal/sa_unreal.json) | `0.262` |
| GTA IV | [gta_iv.json](https://github.com/sannybuilder/library/blob/master/gta_iv/gta_iv.json) | `0.78` |
| Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.223` |
| Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.226` |
| Unknown (32-bit) | [unknown_x86.json](https://github.com/sannybuilder/library/blob/master/unknown_x86/unknown_x86.json) | `0.225` |
| Unknown (64-bit) | [unknown_x64.json](https://github.com/sannybuilder/library/blob/master/unknown_x64/unknown_x64.json) | `0.228` |
| Bully: Scholarship Edition | [bully.json](https://github.com/sannybuilder/library/blob/master/bully/bully.json) | `0.41` |

CLEO Redux uses compound definitions (a combination of the primary JSON file for the current game and a JSON file for the Unknown host). It lets SDK commands to work in JS scripts regardless of them being defined or not in the primary JSON file. You should notice that during updates CLEO downloads both `<game>.json` and `unknown.json` as well as the accompanying `enums.js` files. It should not affect any existing scripts.
12 changes: 6 additions & 6 deletions docs/en/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cancel(); // the event callback won't be called anymore

Triggered after the game creates a new vehicle of any type in the world. An event's `data` object contains the address of the vehicle structure.

Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)`
Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)`

```ts
interface OnVehicleCreateEvent {
Expand All @@ -74,7 +74,7 @@ addEventListener("OnVehicleCreate", (event: OnVehicleCreateEvent) => {

Triggered after the game creates a new ped of any type in the world. An event's `data` object contains the address of the ped structure.

Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)`
Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)`

```ts
interface OnPedCreateEvent {
Expand All @@ -97,7 +97,7 @@ addEventListener("OnPedCreate", (event: OnPedCreateEvent) => {

Triggered after the game creates a new object of any type in the world. An event's `data` object contains the address of the object structure.

Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)`
Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)`

```ts
interface OnObjectCreateEvent {
Expand All @@ -120,7 +120,7 @@ addEventListener("OnObjectCreate", (event: OnObjectCreateEvent) => {

Triggered _before_ the game deletes a vehicle from the world. An event's `data` object contains the address of the vehicle structure.

Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)`
Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)`

```ts
interface OnVehicleDeleteEvent {
Expand All @@ -143,7 +143,7 @@ addEventListener("OnVehicleDelete", (event: OnVehicleDeleteEvent) => {

Triggered _before_ the game deletes a ped from the world. An event's `data` object contains the address of the ped structure.

Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)`
Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)`

```ts
interface OnPedDeleteEvent {
Expand All @@ -166,7 +166,7 @@ addEventListener("OnPedDelete", (event: OnPedDeleteEvent) => {

Triggered _before_ the game deletes an object from the world. An event's `data` object contains the address of the object structure.

Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.8.11827)`, `GTA VC: DE (1.0.8.11827)`, `GTA SA: DE (1.0.8.11827)`
Supported in: `re3`, `reVC`, `GTA III`, `GTA VC`, `GTA SA`, `GTA III: DE (1.0.17.39540)`, `GTA VC: DE (1.0.17.39540)`, `GTA SA: DE (1.0.17.39540)`

```ts
interface OnObjectDeleteEvent {
Expand Down
22 changes: 14 additions & 8 deletions installer/cleo_redux.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define AppName "CLEO Redux"
#define AppVersion "1.1.3"
#define AppVersion "1.2.0"
#define AppPublisher "Seemann"
#define AppURL "https://re.cleo.li"
#define SourceDir "..\"
Expand Down Expand Up @@ -63,7 +63,7 @@ Name: "plugins/imgui/SilentPatch"; Description: "SilentPatch - needed for the mo
Name: "plugins/memops"; Description: "MemoryOperations (by ThirteenAG)"; Types: full
Name: "plugins/input"; Description: "Input 1.3"; Types: full
Name: "plugins/frontend"; Description: "Frontend 1.1"; Types: full
Name: "plugins/events"; Description: "Events 1.0"; Types: full
Name: "plugins/events"; Description: "Events 1.1"; Types: full
Name: "loaders"; Description: "File Loaders"; Types: full
Name: "loaders/text"; Description: "*.txt, *.text (Text files)"; Types: full
Name: "loaders/ide"; Description: "*.ide (Item Definition files)"; Types: full
Expand Down Expand Up @@ -531,14 +531,15 @@ begin
WizardForm.ComponentsList.Checked[14] := False;
end;
// ImGuiRedux is bugged on re3
if isRe then
// ImGuiRedux is bugged on re3/DE
if isRe or Is3Master() or IsVCMaster() or IsSAMaster() then
begin
// ImGuiRedux
WizardForm.ComponentsList.Checked[5] := False;
// D3 Wrapper
WizardForm.ComponentsList.Checked[6] := False;
WizardForm.ComponentsList.ItemEnabled[6] := False;
end;
// MSS lib is an ASI loader
Expand Down Expand Up @@ -569,6 +570,11 @@ begin
if (CurPageID = wpSelectDir) and (WizardDirValue <> '') then
begin
if ((DirExists(WizardDirValue + '\Gameface\Binaries\Win64')) and (
FileExists(WizardDirValue + '\PlayGTA3.exe') or
FileExists(WizardDirValue + '\PlayGTAViceCity.exe') or
FileExists(WizardDirValue + '\PlayGTASanAndreas.exe'))) then
WizardForm.DirEdit.Text := WizardDirValue + '\Gameface\Binaries\Win64';
FGameId := IdentifyGame(WizardDirValue);
end;
Expand All @@ -594,14 +600,14 @@ begin
begin
if IsX64() then
if isRe then
DownloadPage.Add('{#UAL64}/d3d9.zip', 'd3d9.zip', '')
DownloadPage.Add('{#UAL64}/d3d9-x64.zip', 'd3d9.zip', '')
else
DownloadPage.Add('{#UAL64}/version.zip', 'version.zip', '');
DownloadPage.Add('{#UAL64}/version-x64.zip', 'version.zip', '');
if IsX86() then
if IsGta3 or IsVC or IsIV then
DownloadPage.Add('{#UAL32}/dinput8.zip', 'dinput8.zip', '')
DownloadPage.Add('{#UAL32}/dinput8-Win32.zip', 'dinput8.zip', '')
else
DownloadPage.Add('{#UAL32}/vorbisFile.zip', 'vorbisFile.zip', '');
DownloadPage.Add('{#UAL32}/vorbisFile-Win32.zip', 'vorbisFile.zip', '');
end;
if FDlMemOpsPlugin then
Expand Down
46 changes: 18 additions & 28 deletions plugins/Events/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions plugins/Events/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "events"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
authors = ["Seemann <[email protected]>"]

Expand All @@ -12,10 +12,7 @@ crate-type = ["cdylib"]
cleo_redux_sdk = "*"
ctor = "0.1.21"
null_fn = "0.1.1"
detour = {git = "https://github.com/x87/detour-rs.git"}
retour = "0.1.0"
serde = {version = "1.0.144", features = ["derive"]}
serde_json = {version = "1.0.85", features = ["preserve_order"]}
lazy_static = "1.4.0"
version_info = "*"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["libloaderapi"] }
lazy_static = "1.4.0"
22 changes: 8 additions & 14 deletions plugins/Events/src/gta_classic/cworld_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,20 @@ static mut CWORLD_ADD: extern "C" fn(*const u8) = std::ptr::null();

lazy_static! {
static ref CWORLD_ADD_ADDR: Option<usize> = {
use crate::utils::{get_exe_version, IMAGE_BASE};
use cleo_redux_sdk::HostId;

match cleo_redux_sdk::get_host_id() {
HostId::RE3 | HostId::REVC => match cleo_redux_sdk::get_symbol_address("CWorld::Add") {
HostId::RE3
| HostId::REVC
| HostId::GTA3
| HostId::VC
| HostId::SA
| HostId::GTA3_UNREAL
| HostId::VC_UNREAL
| HostId::SA_UNREAL => match cleo_redux_sdk::get_symbol_address("CWorld::Add") {
0 => None,
x => Some(x),
},
HostId::GTA3 => Some(0x004AE930),
HostId::VC => Some(0x004DB3F0),
HostId::SA => Some(0x00563220),
HostId::GTA3_UNREAL if get_exe_version("LibertyCity.exe") == Some((1, 0, 8, 11827)) => {
Some(*IMAGE_BASE + 0xF34DB0)
}
HostId::VC_UNREAL if get_exe_version("ViceCity.exe") == Some((1, 0, 8, 11827)) => {
Some(*IMAGE_BASE + 0xF569F0)
}
HostId::SA_UNREAL if get_exe_version("SanAndreas.exe") == Some((1, 0, 8, 11827)) => {
Some(*IMAGE_BASE + 0x100AF70)
}
_ => None,
}
};
Expand Down
30 changes: 11 additions & 19 deletions plugins/Events/src/gta_classic/cworld_remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,20 @@ static mut CWORLD_REMOVE: extern "C" fn(*const u8) = std::ptr::null();

lazy_static! {
static ref CWORLD_REMOVE_ADDR: Option<usize> = {
use crate::utils::{get_exe_version, IMAGE_BASE};
use cleo_redux_sdk::HostId;

match cleo_redux_sdk::get_host_id() {
HostId::RE3 | HostId::REVC => {
match cleo_redux_sdk::get_symbol_address("CWorld::Remove") {
0 => None,
x => Some(x),
}
}
HostId::GTA3 => Some(0x004AE9D0),
HostId::VC => Some(0x004DB310),
HostId::SA => Some(0x00563280),
HostId::GTA3_UNREAL if get_exe_version("LibertyCity.exe") == Some((1, 0, 8, 11827)) => {
Some(*IMAGE_BASE + 0xF34E90)
}
HostId::VC_UNREAL if get_exe_version("ViceCity.exe") == Some((1, 0, 8, 11827)) => {
Some(*IMAGE_BASE + 0xF56AE0)
}
HostId::SA_UNREAL if get_exe_version("SanAndreas.exe") == Some((1, 0, 8, 11827)) => {
Some(*IMAGE_BASE + 0x100AFB0)
}
HostId::RE3
| HostId::REVC
| HostId::GTA3
| HostId::VC
| HostId::SA
| HostId::GTA3_UNREAL
| HostId::VC_UNREAL
| HostId::SA_UNREAL => match cleo_redux_sdk::get_symbol_address("CWorld::Remove") {
0 => None,
x => Some(x),
},
_ => None,
}
};
Expand Down
2 changes: 1 addition & 1 deletion plugins/Events/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ extern "C" {}

#[ctor]
fn init() {
cleo_redux_sdk::log("Events plugin 1.0");
cleo_redux_sdk::log("Events plugin 1.1");
gta_classic::register_hooks();
}
11 changes: 1 addition & 10 deletions plugins/Events/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
use version_info;
lazy_static! {
pub static ref IMAGE_BASE: usize =
unsafe { winapi::um::libloaderapi::GetModuleHandleA(std::ptr::null()) as usize };
}

#[macro_export]
macro_rules! detour {
( $addr: expr => $cb: expr ) => {{
let hook = detour::RawDetour::new($addr as *const (), $cb as *const ()).unwrap();
let hook = retour::RawDetour::new($addr as *const (), $cb as *const ()).unwrap();
hook.enable().unwrap();
let result = std::mem::transmute(hook.trampoline());
std::mem::forget(hook);
result
}};
}

pub fn get_exe_version(exe_name: &str) -> Option<(u32, u32, u32, u32)> {
version_info::get_file_version(exe_name)
}
2 changes: 1 addition & 1 deletion website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ <h1 class="font-weight-bold d-flex justify-content-center">
data-translate="download"
>Download</a
>
<small class="pt-1 text-muted">v1.1.3 | February 21, 2023</small>
<small class="pt-1 text-muted">v1.2.0 | June 19, 2023</small>
</div>
</div>
</div>
Expand Down

0 comments on commit 1e9a1ca

Please sign in to comment.