From e93cb4df0cc05a53563b1919bf4c0c0d70f9f6d4 Mon Sep 17 00:00:00 2001 From: azw Date: Wed, 16 Aug 2023 21:31:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=B6=88=E6=81=AF=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/robot/clientnet.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/robot/clientnet.js b/tools/robot/clientnet.js index 2d30bcb9..162e7fd6 100644 --- a/tools/robot/clientnet.js +++ b/tools/robot/clientnet.js @@ -195,7 +195,9 @@ class ClientNet { console.log('unknown command'); return; } - const msg = {}; + const msgBody = line.slice(line.indexOf(msgName) + msgName.length + 1); + const msg = eval('({' + msgBody + '})'); + /*const msg = {}; for (let i = 0; i < msgType.fieldsArray.length; ++i) { if (i < msgFields.length) { const name = msgType.fieldsArray[i].name; @@ -207,7 +209,7 @@ class ClientNet { } } } - console.log(msg); + console.log(msg);*/ this.sendMsg(msgName, msg); }