mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Add error checking
This commit is contained in:
@@ -13,6 +13,10 @@
|
|||||||
{
|
{
|
||||||
document.getElementById("loadingWebassembly").innerText = "Error! SharedArrayBuffer is not defined. This page required the CORP and COEP response headers.";
|
document.getElementById("loadingWebassembly").innerText = "Error! SharedArrayBuffer is not defined. This page required the CORP and COEP response headers.";
|
||||||
}
|
}
|
||||||
|
if (!window.WebAssembly)
|
||||||
|
{
|
||||||
|
document.getElementById("loadingWebassembly").innerText = "Error! This page requires WebAssembly. Please upgrade your browser or enable WebAssembly support.";
|
||||||
|
}
|
||||||
|
|
||||||
window.Module = await window.OPENRCT2_WEB(
|
window.Module = await window.OPENRCT2_WEB(
|
||||||
{
|
{
|
||||||
@@ -160,8 +164,12 @@ async function updateAssets() {
|
|||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.log("No asset version found");
|
console.log("No asset version found");
|
||||||
};
|
};
|
||||||
|
let assetsVersion = "DEBUG";
|
||||||
const assets_version = Module.ccall("GetVersion", "string");
|
try {
|
||||||
|
assetsVersion = Module.ccall("GetVersion", "string");
|
||||||
|
} catch(e) {
|
||||||
|
console.warn("Could not call 'GetVersion'! Is it added to EXPORTED_FUNCTIONS? Is ccall added to EXPORTED_RUNTIME_METHODS?");
|
||||||
|
};
|
||||||
|
|
||||||
//Always pull assets on a debug build
|
//Always pull assets on a debug build
|
||||||
if (currentVersion !== assets_version || assets_version.includes("DEBUG"))
|
if (currentVersion !== assets_version || assets_version.includes("DEBUG"))
|
||||||
|
|||||||
Reference in New Issue
Block a user