stuff
This commit is contained in:
parent
a743aa3851
commit
1ac7e27638
8 changed files with 98 additions and 61 deletions
9
.config example
Normal file
9
.config example
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# VERSION
|
||||
VERSION=""
|
||||
# NETWORKING
|
||||
NET_KEYCHIP_ID=""
|
||||
NET_HOSTNAME=""
|
||||
# PORT BINDINGS
|
||||
PORT_CONSOLE_LEFT=""
|
||||
PORT_CONSOLE_RIGHT=""
|
||||
PORT_AIME_READER=""
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
images/*
|
||||
images/*
|
||||
.config
|
||||
|
|
@ -7,6 +7,7 @@ fi
|
|||
|
||||
profile="$1"
|
||||
|
||||
source .config
|
||||
source ./profiles/$profile/metadata
|
||||
dir="/tmp/wacca/$profile"
|
||||
PATCHES_DIR="./patches"
|
||||
|
|
@ -22,26 +23,21 @@ for script in $(ls -1v 2>/dev/null); do
|
|||
|
||||
echo -e "\033[0;34m=== Applying: $script ===\033[0m"
|
||||
|
||||
# Use a temporary file to capture exit status and output
|
||||
temp_file=$(mktemp)
|
||||
# Create a named pipe for real-time output
|
||||
pipe=$(mktemp -u)
|
||||
mkfifo "$pipe"
|
||||
|
||||
# Source the script and capture both stdout and stderr
|
||||
if (source "$script") > "$temp_file" 2>&1; then
|
||||
# Script succeeded - output with script name prefix
|
||||
while IFS= read -r line; do
|
||||
echo "[$script] $line"
|
||||
done < "$temp_file"
|
||||
# Execute the script with real-time output
|
||||
if (source "$script" 2>&1 | while IFS= read -r line; do
|
||||
echo "[$script] $line"
|
||||
done); then
|
||||
echo -e "\033[0;32m=== Successfully applied: $script ======\033[0m"
|
||||
else
|
||||
exit_code=$?
|
||||
# Script failed - output with script name prefix and error message
|
||||
while IFS= read -r line; do
|
||||
echo "[$script] $line"
|
||||
done < "$temp_file"
|
||||
echo -e "\033[0;31m=== Failed: $script (exit code: $exit_code) ===\033[0m"
|
||||
fi
|
||||
|
||||
rm -f "$temp_file"
|
||||
# Clean up the pipe
|
||||
rm -f "$pipe"
|
||||
echo
|
||||
done
|
||||
|
||||
done
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
sed -i '/^\[\/Script\/Mercury.MercuryNetworkSettings\]/,/^OfflineMode=false/ s/^OfflineMode=false/OfflineMode=true/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultHardware.ini
|
||||
|
||||
|
|
@ -8,4 +8,15 @@ sed -i '/^\[vfs\]/,/^\[/ {
|
|||
/^amfs=/c\amfs=..\\\\..\\\\segatools\\\\amfs
|
||||
/^option=/c\option=..\\\\..\\\\segatools\\\\option
|
||||
/^appdata=/c\appdata=..\\\\..\\\\segatools\\\\appdata
|
||||
}' $dir/game/bin/segatools.ini
|
||||
}' $dir/game/bin/segatools.ini
|
||||
|
||||
if [ -z ${PORT_AIME_READER+x} ]; then echo "\$Card reader binding not set, skipping."; else
|
||||
echo "Card reader binding set, disabling card reader assembly emulation"
|
||||
sed -i '/^\[aime\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools.ini
|
||||
fi
|
||||
if [ -z ${PORT_CONSOLE_LEFT+x} ]; then echo "\$Left console binding not set, skipping."; else
|
||||
if [ -z ${PORT_CONSOLE_RIGHT+x} ]; then echo "\$Right console binding not set, skipping."; else
|
||||
echo "Console binding set, disabling mercuryio touch hooks"
|
||||
sed -i '/^\[touch\]/,/^enable=1/ s/^enable=1/enable=0/' $dir/game/bin/segatools.ini
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
12
patches/11-networking.sh
Normal file
12
patches/11-networking.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
if [ -z ${NET_HOSTNAME+x} ]; then
|
||||
echo "Server hostname not set, skipping.";
|
||||
sed -i '/^\[\/Script\/Mercury.MercuryNetworkSettings\]/,/^OfflineMode=false/ s/^OfflineMode=false/OfflineMode=true/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultHardware.ini
|
||||
else
|
||||
if [ -z ${NET_KEYCHIP_ID+x} ]; then
|
||||
echo "Keychip id not set, skipping.";
|
||||
sed -i '/^\[\/Script\/Mercury.MercuryNetworkSettings\]/,/^OfflineMode=false/ s/^OfflineMode=false/OfflineMode=true/' $dir/game/WindowsNoEditor/Mercury/Config/DefaultHardware.ini
|
||||
else
|
||||
sed -i "/^\[dns\]/,/^default=127.0.0.1/ s/^default=127.0.0.1/default=$NET_HOSTNAME/" $dir/game/bin/segatools.ini
|
||||
sed -i "/^\[keychip\]/,/^id=A69E-01A88888888/ s/^id=A69E-01A88888888/id=$NET_KEYCHIP_ID/" $dir/game/bin/segatools.ini
|
||||
fi
|
||||
fi
|
||||
|
|
@ -1,3 +1,10 @@
|
|||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM1 /t REG_SZ /d "/dev/tnt0" #aime reader
|
||||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM3 /t REG_SZ /d "/dev/tnt2" #Console touch left
|
||||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM4 /t REG_SZ /d "/dev/tnt4" #Console touch right
|
||||
if [ -z ${PORT_CONSOLE_LEFT+x} ]; then echo "Left console binding not set, skipping."; else
|
||||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM3 /t REG_SZ /d "$PORT_CONSOLE_LEFT" #Console touch left
|
||||
fi
|
||||
if [ -z ${PORT_CONSOLE_RIGHT+x} ]; then echo "Right console binding not set, skipping."; else
|
||||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM4 /t REG_SZ /d "$PORT_CONSOLE_RIGHT" #Console touch right
|
||||
fi
|
||||
if [ -z ${PORT_AIME_READER+x} ]; then echo "Card reader binding not set, skipping."; else
|
||||
WINEPREFIX=$dir/prefix umu-run reg add "HKEY_LOCAL_MACHINE\\Software\\Wine\\Ports" /f /v COM1 /t REG_SZ /d "$PORT_AIME_READER" #aime reader
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1,42 +1,45 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
versions=()
|
||||
count=0
|
||||
for profile_dir in profiles/*/; do
|
||||
# Remove the trailing slash to get clean directory name
|
||||
count=$[count+1]
|
||||
echo $profile_dir
|
||||
source $profile_dir/metadata
|
||||
echo $prettyname
|
||||
versions+=("$version" "$prettyname")
|
||||
done
|
||||
exec 3>&1;
|
||||
sel=$(dialog --menu "Select major version" 20 60 10 "${versions[@]}" 2>&1 1>&3)
|
||||
for profile_dir in profiles/*/; do
|
||||
source $profile_dir/metadata
|
||||
if [[ "$sel" == "$version" ]]; then
|
||||
profile=$(basename $profile_dir)
|
||||
versions2=()
|
||||
count=0
|
||||
while IFS=, read -r vhd version identifier backingversion parent_identifier parent_filename
|
||||
do
|
||||
echo $vhd
|
||||
count=$[count+1]
|
||||
versions2+=("$version" "$vhd")
|
||||
done < images/lookup/phase1_$profile.csv
|
||||
echo "${versions2[@]}"
|
||||
exec 3>&1;
|
||||
sel=$(dialog --menu "Select an item:" 20 60 10 "${versions2[@]}" 2>&1 1>&3)
|
||||
echo $sel
|
||||
fi
|
||||
done
|
||||
# profile="$1"
|
||||
# versions=()
|
||||
# count=0
|
||||
# while IFS=, read -r vhd version identifier backingversion parent_identifier parent_filename
|
||||
# do
|
||||
# count=$[count+1]
|
||||
# versions+=("$count" "$version")
|
||||
# done < images/lookup/phase1_$1.csv
|
||||
# dialog --menu "Select an item:" 20 60 10 "${versions[@]}"
|
||||
selectversion() {
|
||||
versions=()
|
||||
count=0
|
||||
for profile_dir in profiles/*/; do
|
||||
# Remove the trailing slash to get clean directory name
|
||||
count=$[count+1]
|
||||
echo $profile_dir
|
||||
source $profile_dir/metadata
|
||||
echo $prettyname
|
||||
versions+=("$version" "$prettyname")
|
||||
done
|
||||
exec 3>&1;
|
||||
sel=$(dialog --menu "Select major version" 20 60 10 "${versions[@]}" 2>&1 1>&3)
|
||||
for profile_dir in profiles/*/; do
|
||||
source $profile_dir/metadata
|
||||
if [[ "$sel" == "$version" ]]; then
|
||||
profile=$(basename $profile_dir)
|
||||
versions2=()
|
||||
count=0
|
||||
while IFS=, read -r vhd version identifier backingversion parent_identifier parent_filename
|
||||
do
|
||||
echo $vhd
|
||||
count=$[count+1]
|
||||
versions2+=("$version" "$vhd")
|
||||
done < images/lookup/phase1_$profile.csv
|
||||
exec 3>&1;
|
||||
sel=$(dialog --menu "Select an item:" 20 60 10 "${versions2[@]}" 2>&1 1>&3)
|
||||
sed -i "s/VERSION=.*/VERSION=\"$sel\"/" .config
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
setserver() {
|
||||
source .config
|
||||
exec 3>&1;
|
||||
hostname=$(dialog --inputbox "Modify server hostname" 10 30 "${NET_HOSTNAME:-hostname.tld}" 2>&1 1>&3)
|
||||
keychip=$(dialog --inputbox "Modify keychip id" 10 30 "${NET_KEYCHIP_ID:-A$(printf "%02d" $((RANDOM % 100)))$(shuf -e E X | head -n1)-$(shuf -e 01 20 | head -n1)$(shuf -e A B C D U | head -n1)$(tr -dc 0-9 </dev/urandom | head -c 8)}" 2>&1 1>&3)
|
||||
sed -i "s/NET_HOSTNAME=.*/NET_HOSTNAME=\"$hostname\"/" .config
|
||||
sed -i "s/NET_KEYCHIP_ID=.*/NET_KEYCHIP_ID=\"$keychip\"/" .config
|
||||
}
|
||||
setserver
|
||||
# selectversion
|
||||
Loading…
Reference in a new issue