mirror of
https://github.com/d07RiV/diabloweb.git
synced 2026-07-03 11:51:35 +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",
|
"name": "diabloweb",
|
||||||
"version": "1.0.33",
|
"version": "1.0.34",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "diabloweb",
|
"name": "diabloweb",
|
||||||
"version": "1.0.33",
|
"version": "1.0.34",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "7.4.3",
|
"@babel/core": "7.4.3",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reportLink(e, retail) {
|
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");
|
const url = new URL("https://github.com/d07RiV/diabloweb/issues/new");
|
||||||
url.searchParams.set("body",
|
url.searchParams.set("body",
|
||||||
`**Description:**
|
`**Description:**
|
||||||
|
|||||||
@@ -287,9 +287,12 @@ function try_api(func) {
|
|||||||
|
|
||||||
function call_api(func, ...params) {
|
function call_api(func, ...params) {
|
||||||
try_api(() => {
|
try_api(() => {
|
||||||
|
const nested = (audioBatch != null);
|
||||||
|
if (!nested) {
|
||||||
audioBatch = [];
|
audioBatch = [];
|
||||||
audioTransfer = [];
|
audioTransfer = [];
|
||||||
packetBatch = [];
|
packetBatch = [];
|
||||||
|
}
|
||||||
if (func !== "text") {
|
if (func !== "text") {
|
||||||
wasm["_" + func](...params);
|
wasm["_" + func](...params);
|
||||||
} else {
|
} else {
|
||||||
@@ -303,6 +306,7 @@ function call_api(func, ...params) {
|
|||||||
heap[ptr + length] = 0;
|
heap[ptr + length] = 0;
|
||||||
wasm._DApi_SyncText(params[1]);
|
wasm._DApi_SyncText(params[1]);
|
||||||
}
|
}
|
||||||
|
if (!nested) {
|
||||||
if (audioBatch.length) {
|
if (audioBatch.length) {
|
||||||
maxSoundId = maxBatchId;
|
maxSoundId = maxBatchId;
|
||||||
worker.postMessage({action: "audioBatch", batch: audioBatch}, audioTransfer);
|
worker.postMessage({action: "audioBatch", batch: audioBatch}, audioTransfer);
|
||||||
@@ -313,6 +317,7 @@ function call_api(func, ...params) {
|
|||||||
audioBatch = null;
|
audioBatch = null;
|
||||||
audioTransfer = null;
|
audioTransfer = null;
|
||||||
packetBatch = null;
|
packetBatch = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user