From d6137b62d6762222d71b96fe7a3cbc482f2f7fd8 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 22 Mar 2025 20:22:48 -0400 Subject: [PATCH] Build with Oodle on the CI This makes it possible to use Kawari easily without compilation. You still need to acquire Oodle yourself since we build with the shared library version of Oodle. The USAGE instructions is modified accordingly. --- .github/workflows/main.yml | 33 ++++++++++++++++++++++++++++++--- USAGE.md | 13 +++++++++++-- src/oodle.rs | 3 +-- 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af79e1e..e52db4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,22 +30,49 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: robinraju/release-downloader@v1 + if: runner.os == 'Linux' + with: + repository: 'WorkingRobot/OodleUE' + fileName: 'gcc.zip' + latest: true + extract: true + - if: runner.os == 'Linux' + run: | + mkdir oodle + cp lib/Release/liboodle-network-shared.so oodle/ + - uses: robinraju/release-downloader@v1 + if: runner.os == 'Windows' + with: + repository: 'WorkingRobot/OodleUE' + fileName: 'clang-cl.zip' + latest: true + extract: true + - if: runner.os == 'Windows' + run: | + mkdir oodle + cp ar/Release/oodle-network-shared.lib oodle/ - name: Build - run: cargo build --release --verbose --no-default-features + run: cargo build --release --verbose - name: Run clippy - run: cargo clippy --no-default-features + run: cargo clippy - name: Run tests - run: cargo test --verbose --no-default-features + run: cargo test --verbose - name: Archive artifacts uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-package path: | + LICENSE + USAGE.md + README.md + Caddyfile target/release/kawari-admin* target/release/kawari-frontier* target/release/kawari-lobby* target/release/kawari-login* target/release/kawari-patch* target/release/kawari-web* + target/release/kawari-world* !target/release/*.d if-no-files-found: error diff --git a/USAGE.md b/USAGE.md index 4cac8ca..f3873ad 100644 --- a/USAGE.md +++ b/USAGE.md @@ -9,13 +9,22 @@ Kawari is designed to be easy to run, with the goal of being accessible to anyon **Kawari requires that you have an active subscription**, and are in possession of a legitimate copy of the game. Kawari is not related or affiliated to SqEx, and by using it you are in explicit violation of the User Agreement (_Limitation 2.4_.) ## Prerequisites + * Windows or Linux * Copy of the game updated to the supported game version (see README) -* Oodle Network Compression (can be obtained from [here](https://github.com/WorkingRobot/OodleUE), place static library (`.a`) into `oodle` directory) +* Oodle Network Compression (can be obtained from [here](https://github.com/WorkingRobot/OodleUE) + +## Download Artifact + +Windows and Linux artifacts are built on every commit, under [Github Actions](https://github.com/redstrate/Kawari/actions). You will have to download the Oodle Network `.dll` (Windows) or `.so` (Linux) yourself however. + +## Building + +Build Kawari with `cargo build`. If you're building with Oodle support, place the `.so` (Linux) or `.lib` (Windows) into the `oodle` directory when building. The library must be named "oodle-network-shared". ## Setup -Build Kawari with `cargo build`. Afterwards, create a `config.yaml` in the current directory. Currently the minimal config you need to run most services looks like this: +Afterwards, create a `config.yaml` in the current directory. Currently the minimal config you need to run most services looks like this: ```yaml game_location: pathtogamedir diff --git a/src/oodle.rs b/src/oodle.rs index fc04c78..401366a 100644 --- a/src/oodle.rs +++ b/src/oodle.rs @@ -1,8 +1,7 @@ use std::{ffi::c_void, ptr::null}; -// TODO: add support for windows? #[cfg(feature = "oodle")] -#[link(name = "oo2netlinux64")] +#[link(name = "oodle-network-shared")] unsafe extern "C" { pub fn OodleNetwork1TCP_State_Size() -> isize; pub fn OodleNetwork1_Shared_Size(htbits: i32) -> isize;