aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstonedDiscord <10584181+stonedDiscord@users.noreply.github.com>2020-09-26 20:19:39 +0200
committerstonedDiscord <10584181+stonedDiscord@users.noreply.github.com>2020-09-26 20:19:39 +0200
commitcaf624586706a44029f0ef447e3d53c383c96dc5 (patch)
treec5cdbc557672a64572853765d06a959e22db5621
parent99da1361da8921c975b590a96870686eb886c5c9 (diff)
deal with messages that are grouped together
-rw-r--r--webAO/client.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/webAO/client.js b/webAO/client.js
index f196dac..7848398 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -514,11 +514,17 @@ class Client extends EventEmitter {
console.debug("S: " + msg);
const lines = msg.split("%");
- const args = lines[0].split("#");
- const header = args[0];
- if (!this.emit(header, args)) {
- console.warn(`Invalid packet header ${header}`);
+ for (const msg of lines) {
+ if(msg === "")
+ break;
+
+ const args = msg.split("#");
+ const header = args[0];
+
+ if (!this.emit(header, args)) {
+ console.warn(`Invalid packet header ${header}`);
+ }
}
}