diff options
| author | stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> | 2020-09-26 20:19:39 +0200 |
|---|---|---|
| committer | stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> | 2020-09-26 20:19:39 +0200 |
| commit | caf624586706a44029f0ef447e3d53c383c96dc5 (patch) | |
| tree | c5cdbc557672a64572853765d06a959e22db5621 /webAO | |
| parent | 99da1361da8921c975b590a96870686eb886c5c9 (diff) | |
deal with messages that are grouped together
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.js | 14 |
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}`); + } } } |
