mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-19 18:36:25 +00:00
Append -beta to the version number, define compression on window
Some checks failed
Make Latest Folder On EmulatorJS CDN / run (push) Has been cancelled
Some checks failed
Make Latest Folder On EmulatorJS CDN / run (push) Has been cancelled
This commit is contained in:
parent
e8c9d0d28b
commit
735c20b3be
3 changed files with 17 additions and 9 deletions
|
@ -100,3 +100,5 @@ class EJS_COMPRESSION {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.EJS_COMPRESSION = EJS_COMPRESSION;
|
||||
|
|
|
@ -202,20 +202,29 @@ class EmulatorJS {
|
|||
})
|
||||
}
|
||||
checkForUpdates() {
|
||||
if (this.ejs_version.endsWith("-beta")) {
|
||||
console.warn("Using EmulatorJS beta. Not checking for updates. This instance may be out of date. Using stable is highly recommended unless you build and ship your own cores.");
|
||||
return;
|
||||
}
|
||||
fetch('https://cdn.emulatorjs.org/stable/data/version.json').then(response => {
|
||||
if (response.ok) {
|
||||
response.text().then(body => {
|
||||
let version = JSON.parse(body);
|
||||
if (this.ejs_num_version < version.current_version) {
|
||||
console.log('Using EmulatorJS version ' + this.ejs_num_version + ' but the newest version is ' + version.current_version + '\nopen https://github.com/EmulatorJS/EmulatorJS to update');
|
||||
if (this.versionAsInt(this.ejs_version) < this.versionAsInt(version.current_version)) {
|
||||
console.log('Using EmulatorJS version ' + this.versionAsInt(this.ejs_version) + ' but the newest version is ' + this.versionAsInt(version.current_version) + '\nopen https://github.com/EmulatorJS/EmulatorJS to update');
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
versionAsInt(ver) {
|
||||
if (ver.endsWith("-beta")) {
|
||||
return 99999999;
|
||||
}
|
||||
return parseInt(ver.split(".").join(""));
|
||||
}
|
||||
constructor(element, config) {
|
||||
this.ejs_version = "4.0.12";
|
||||
this.ejs_num_version = 401.2;
|
||||
this.ejs_version = "4.0.13-beta";
|
||||
this.debug = (window.EJS_DEBUG_XX === true);
|
||||
if (this.debug || (window.location && ['localhost', '127.0.0.1'].includes(location.hostname))) this.checkForUpdates();
|
||||
this.netplayEnabled = (window.EJS_DEBUG_XX === true) && (window.EJS_EXPERIMENTAL_NETPLAY === true);
|
||||
|
@ -477,7 +486,7 @@ class EmulatorJS {
|
|||
}
|
||||
checkCompression(data, msg, fileCbFunc) {
|
||||
if (!this.compression) {
|
||||
this.compression = new EJS_COMPRESSION(this);
|
||||
this.compression = new window.EJS_COMPRESSION(this);
|
||||
}
|
||||
if (msg) {
|
||||
this.textElem.innerText = msg;
|
||||
|
@ -486,9 +495,6 @@ class EmulatorJS {
|
|||
this.textElem.innerText = appendMsg ? (msg + m) : m;
|
||||
}, fileCbFunc);
|
||||
}
|
||||
versionAsInt(ver) {
|
||||
return parseInt(ver.split(".").join(""));
|
||||
}
|
||||
checkCoreCompatibility(version) {
|
||||
// Leave commented until next release - this is ready to go.
|
||||
if (this.versionAsInt(version.minimumEJSVersion) > this.versionAsInt(this.ejs_version)) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
{ "current_version": 401.2 }
|
||||
{ "current_version": "4.0.12" }
|
||||
|
|
Loading…
Reference in a new issue