Skip to content

Commit

Permalink
Merge pull request #17 from T00fy/master
Browse files Browse the repository at this point in the history
Fix for CK3/other games with similar directory structure
  • Loading branch information
anticitizn authored Jan 14, 2024
2 parents 34234f7 + d016cd7 commit 01f12ce
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ build/
.cache
.vscode
lib/
output
output
.idea
cmake-build-debug/
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ chmod +x cream.sh
Please collect a log using the instructions below, then post an issue describing your situation [here](https://github.com/anticitizn/creamlinux/issues/new).

## Gathering logs
Install `konsole` and set your game launch options to this:
If using a KDE environment, set your game launch options to this:
```
konsole --hold -e sh ./cream.sh %command%
```
Or if you are using Gnome environment, you can set your launch options to this:
```
gnome-terminal -- sh -c "./cream.sh %command%; exec bash"
```
If using neither, install `konsole` and follow the KDE step.
Then launch the game (skip any launchers like the Paradox launcher if possible, they interfere with the logging). Wait for the game to load if applicable, close it, then copy and paste the contents of the terminal.

# Advanced
Expand Down
30 changes: 24 additions & 6 deletions package/cream.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
#!/bin/bash
cp "$PWD/lib32Creamlinux.so" /tmp/lib32Creamlinux.so
cp "$PWD/lib64Creamlinux.so" /tmp/lib64Creamlinux.so
cp "$PWD/$(find . -name "libsteam_api.so" -printf "%P\n" | head -n 1)" /tmp/libsteam_api.so
copy_file() {
cp "$1" "$2" || { echo "Error: Failed to copy $1 to $2"; exit 1; }
}

LIBSTEAM_API_DIR=$(find . -name "libsteam_api.so" -printf "%h\n" | head -n 1)
[ -z "$LIBSTEAM_API_DIR" ] && { echo "Error: libsteam_api.so not found."; exit 1; }
if [ ! -z "$CREAM_CONFIG_PATH" ]; then
if [ ! -f "$CREAM_CONFIG_PATH/cream_api.ini" ]; then
echo "Error: cream_api.ini not found in CREAM_CONFIG_PATH."; exit 1;
fi
else
if [ ! -f "$PWD/cream_api.ini" ]; then
echo "Error: cream_api.ini not found in the current working directory."; exit 1;
fi
fi
if [ -z "$CREAM_CONFIG_PATH" ] && [ "$LIBSTEAM_API_DIR" != "$PWD" ]; then
export CREAM_CONFIG_PATH="$PWD/cream_api.ini"
fi

copy_file "$PWD/lib32Creamlinux.so" /tmp/lib32Creamlinux.so
copy_file "$PWD/lib64Creamlinux.so" /tmp/lib64Creamlinux.so
copy_file "$LIBSTEAM_API_DIR/libsteam_api.so" /tmp/libsteam_api.so

LD_PRELOAD="$LD_PRELOAD /tmp/lib64Creamlinux.so /tmp/lib32Creamlinux.so /tmp/libsteam_api.so" "$@"
EXITCODE=$?
rm /tmp/lib32Creamlinux.so
rm /tmp/lib64Creamlinux.so
rm /tmp/libsteam_api.so
rm -f /tmp/lib32Creamlinux.so /tmp/lib64Creamlinux.so /tmp/libsteam_api.so
exit $EXITCODE
4 changes: 4 additions & 0 deletions package/cream_api.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ disable_steamapps_issubscribedapp = false
1303182 = Crusader Kings III: Royal Court
1303184 = Crusader Kings III: Fate of Iberia
2114760 = Crusader Kings III: Friends & Foes
2311920 = Crusader Kings III: Tours and Tournaments
2311930 = Crusader Kings III: Elegance of the Empire
2313541 = Crusader Kings III: Wards and Wardens
2313540 = Crusader Kings III: Legacy of Persia
801650 = Surviving Mars - Stellaris Dome Set
801710 = Surviving Mars: Deluxe Edition Upgrade Pack
801690 = Surviving Mars: Mysteries Resupply Pack
Expand Down

0 comments on commit 01f12ce

Please sign in to comment.