From 8f7929ad46219873c586291034310ea2c89c4525 Mon Sep 17 00:00:00 2001 From: lqqyt2423 <974923609@qq.com> Date: Sun, 26 Jun 2022 12:11:36 +0800 Subject: [PATCH] web addon: change message version --- web/client/src/lib/message.ts | 2 +- web/message.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/client/src/lib/message.ts b/web/client/src/lib/message.ts index 00c5e00..e361fea 100644 --- a/web/client/src/lib/message.ts +++ b/web/client/src/lib/message.ts @@ -33,7 +33,7 @@ export const parseMessage = (data: ArrayBuffer): IMessage | null => { if (data.byteLength < 39) return null const meta = new Int8Array(data.slice(0, 39)) const version = meta[0] - if (version !== 1) return null + if (version !== 2) return null const type = meta[1] as MessageType if (!allMessageBytes.includes(type)) return null const id = new TextDecoder().decode(data.slice(2, 38)) diff --git a/web/message.go b/web/message.go index fa9a1dc..0300d6a 100644 --- a/web/message.go +++ b/web/message.go @@ -13,7 +13,7 @@ import ( // message: -// type: 0/1/2/3/4 +// type: 0/1/2/3/4/5 // messageFlow // version 1 byte + type 1 byte + id 36 byte + waitIntercept 1 byte + content left bytes @@ -25,7 +25,7 @@ import ( // messageMeta // version 1 byte + type 1 byte + content left bytes -const messageVersion = 1 +const messageVersion = 2 type messageType byte