mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
Attempt to fetch from emulatorjs cdn if core not found locally
This commit is contained in:
parent
ddb5c6092f
commit
011216b876
1 changed files with 20 additions and 6 deletions
|
@ -647,12 +647,26 @@ class EmulatorJS {
|
||||||
let corePath = 'cores/'+filename;
|
let corePath = 'cores/'+filename;
|
||||||
this.downloadFile(corePath, (res) => {
|
this.downloadFile(corePath, (res) => {
|
||||||
if (res === -1) {
|
if (res === -1) {
|
||||||
if (!this.supportsWebgl2) {
|
console.log("File not found, attemping to fetch from emulatorjs cdn");
|
||||||
this.textElem.innerText = this.localization('Outdated graphics driver');
|
this.downloadFile("https://cdn.emulatorjs.org/stable/data/"+corePath, (res) => {
|
||||||
} else {
|
if (res === -1) {
|
||||||
this.textElem.innerText = this.localization('Network Error');
|
if (!this.supportsWebgl2) {
|
||||||
}
|
this.textElem.innerText = this.localization('Outdated graphics driver');
|
||||||
this.textElem.style.color = "red";
|
} else {
|
||||||
|
this.textElem.innerText = this.localization('Network Error');
|
||||||
|
}
|
||||||
|
this.textElem.style.color = "red";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.warn("File was not found locally, but was found on the emulatorjs cdn.\nIt is recommended to download the latest release from here: https://cdn.emulatorjs.org/releases/");
|
||||||
|
gotCore(res.data);
|
||||||
|
this.storage.core.put(filename, {
|
||||||
|
version: this.version,
|
||||||
|
data: res.data
|
||||||
|
});
|
||||||
|
}, (progress) => {
|
||||||
|
this.textElem.innerText = this.localization("Download Game Core") + progress;
|
||||||
|
}, true, {responseType: "arraybuffer", method: "GET"})
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gotCore(res.data);
|
gotCore(res.data);
|
||||||
|
|
Loading…
Reference in a new issue