Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Easy Netplay when starting through Search #1541

Merged
merged 1 commit into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions static/build/.tmp_update/script/netplay/easy-netplay_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,30 +94,33 @@ create_cookie_info() {

# We'll start Retroarch in host mode with -H with the core and rom paths loaded in.
start_retroarch() {
log "RetroArch" "Starting RetroArch..."
echo "*****************************************"
echo "romfullpath: $cookie_rom_path"
echo "platform: ${platform}"
echo "netplaycore: $netplaycore"
echo "core_config_folder: $core_config_folder"
echo "cpuspeed: $cpuspeed"
echo "*****************************************"

# We set core CPU speed for Netplay
if [ -n "$cpuspeed" ]; then
PreviousCPUspeed=$(cat "/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt")
echo -n $cpuspeed >"/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt"
fi

cd /mnt/SDCARD/RetroArch
# sleep 5
HOME=/mnt/SDCARD/RetroArch ./retroarch --appendconfig=./.retroarch/easynetplay_override.cfg -H -L "$netplaycore" "$cookie_rom_path"
# We restore previous core CPU speed
if [ -n "$PreviousCPUspeed" ]; then
echo -n $PreviousCPUspeed >"/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt"
else
rm -f "/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt"
fi
log "RetroArch" "Starting RetroArch..."
echo "*****************************************"
echo "romfullpath: $cookie_rom_path"
echo "platform: ${platform}"
echo "netplaycore: $netplaycore"
echo "core_config_folder: $core_config_folder"
echo "cpuspeed: $cpuspeed"
echo "*****************************************"

# Cleanup $cookie_rom_path if it contains "/mnt/SDCARD/Emu/XX(ANYTHINGHERE)/launch.sh:"
cookie_rom_path=$(echo "$cookie_rom_path" | sed 's|/mnt/SDCARD/Emu/.*/launch.sh:||')

# We set core CPU speed for Netplay
if [ -n "$cpuspeed" ]; then
PreviousCPUspeed=$(cat "/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt")
echo -n $cpuspeed > "/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt"
fi

cd /mnt/SDCARD/RetroArch
# sleep 5
HOME=/mnt/SDCARD/RetroArch ./retroarch --appendconfig=./.retroarch/easynetplay_override.cfg -H -L "$netplaycore" "$cookie_rom_path"
# We restore previous core CPU speed
if [ -n "$PreviousCPUspeed" ]; then
echo -n $PreviousCPUspeed > "/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt"
else
rm -f "/mnt/SDCARD/Saves/CurrentProfile/config/${core_config_folder}/cpuclock.txt"
fi
}

cleanup() {
Expand Down
Loading