mirror of
https://github.com/d07RiV/diabloweb.git
synced 2026-06-03 21:41:38 +00:00
fix multiplayer crash #77
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "diabloweb",
|
||||
"version": "1.0.33",
|
||||
"version": "1.0.34",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "diabloweb",
|
||||
"version": "1.0.33",
|
||||
"version": "1.0.34",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/core": "7.4.3",
|
||||
|
||||
@@ -19,7 +19,7 @@ if (process.env.NODE_ENV === 'production') {
|
||||
}
|
||||
|
||||
function reportLink(e, retail) {
|
||||
const message = e.stack || e.message || "Unknown error";
|
||||
const message = (e.message || "Unknown error") + (e.stack ? "\n" + e.stack : "");
|
||||
const url = new URL("https://github.com/d07RiV/diabloweb/issues/new");
|
||||
url.searchParams.set("body",
|
||||
`**Description:**
|
||||
|
||||
@@ -287,9 +287,12 @@ function try_api(func) {
|
||||
|
||||
function call_api(func, ...params) {
|
||||
try_api(() => {
|
||||
audioBatch = [];
|
||||
audioTransfer = [];
|
||||
packetBatch = [];
|
||||
const nested = (audioBatch != null);
|
||||
if (!nested) {
|
||||
audioBatch = [];
|
||||
audioTransfer = [];
|
||||
packetBatch = [];
|
||||
}
|
||||
if (func !== "text") {
|
||||
wasm["_" + func](...params);
|
||||
} else {
|
||||
@@ -303,16 +306,18 @@ function call_api(func, ...params) {
|
||||
heap[ptr + length] = 0;
|
||||
wasm._DApi_SyncText(params[1]);
|
||||
}
|
||||
if (audioBatch.length) {
|
||||
maxSoundId = maxBatchId;
|
||||
worker.postMessage({action: "audioBatch", batch: audioBatch}, audioTransfer);
|
||||
if (!nested) {
|
||||
if (audioBatch.length) {
|
||||
maxSoundId = maxBatchId;
|
||||
worker.postMessage({action: "audioBatch", batch: audioBatch}, audioTransfer);
|
||||
}
|
||||
if (packetBatch.length) {
|
||||
worker.postMessage({action: "packetBatch", batch: packetBatch}, packetBatch);
|
||||
}
|
||||
audioBatch = null;
|
||||
audioTransfer = null;
|
||||
packetBatch = null;
|
||||
}
|
||||
if (packetBatch.length) {
|
||||
worker.postMessage({action: "packetBatch", batch: packetBatch}, packetBatch);
|
||||
}
|
||||
audioBatch = null;
|
||||
audioTransfer = null;
|
||||
packetBatch = null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user