mirror of
https://github.com/Ramaerel/emulatorjs-GameLibrary.git
synced 2026-02-06 10:56:54 +00:00
Fix issues in play.php
Play.php wasn't working - Minor logic errors in cloud save and load broke it.
This commit is contained in:
parent
45ddb008b3
commit
b14becab5b
9
play.php
9
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 = "<?php echo($_GET['rom']); ?>";
|
||||
const gameName = "<?php echo($_GET['game']); ?>";
|
||||
|
||||
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", <?php echo('"./saves/' . $_GET["game"]); ?>.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");
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user