aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/client.js')
-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}`);
+ }
}
}