From b14becab5ba5437b3effdd85bf8f42ddd649333d Mon Sep 17 00:00:00 2001 From: Ramaerel <72925865+Ramaerel@users.noreply.github.com> Date: Sat, 2 Sep 2023 22:55:41 +1000 Subject: [PATCH] Fix issues in play.php Play.php wasn't working - Minor logic errors in cloud save and load broke it. --- play.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/play.php b/play.php index b703f40..75b3cf2 100644 --- a/play.php +++ b/play.php @@ -107,14 +107,14 @@ EJS_core = '$console'; $bios - EJS_gameUrl = '/roms/".$_GET['game']."'; + EJS_gameUrl = './roms/".$_GET['game']."'; EJS_pathtodata = 'data/';"); ?> EJS_onSaveState = function(data) { const stateBlob = new Blob([data.state], { type: "application/octet-stream" }); const screenshotBlob = new Blob([data.screenshot], { type: "image/png" }); - const gameName = ""; + const gameName = ""; const formData = new FormData(); formData.append("gameName", gameName); // Add gameName to the form data @@ -128,7 +128,7 @@ EJS_onLoadState = function() { const xhr = new XMLHttpRequest(); - xhr.open("GET", "./saves/" . $_GET["rom"]); ?>.state", true); + xhr.open("GET", .state", true); xhr.responseType = "arraybuffer"; // Set the response type to arraybuffer xhr.onload = function() { @@ -144,9 +144,6 @@ console.error("Request failed"); }; - xhr.send(); - }; - xhr.onerror = function() { console.error("Request failed"); };