diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-15 15:34:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-15 15:34:55 +0800 |
commit | a93fc2868083ccb5bb190b38a8efa0d65eb2cb9d (patch) | |
tree | 630879a9750da4db5f6b6cc5481223869cd0a3dd /script/service/telemetry.lua | |
parent | 930096359e8d1015c5e4aa0115de1679353b8b88 (diff) | |
download | lua-language-server-a93fc2868083ccb5bb190b38a8efa0d65eb2cb9d.zip |
simple proto
Diffstat (limited to 'script/service/telemetry.lua')
-rw-r--r-- | script/service/telemetry.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/script/service/telemetry.lua b/script/service/telemetry.lua index 82a9199e..18bdb197 100644 --- a/script/service/telemetry.lua +++ b/script/service/telemetry.lua @@ -22,8 +22,12 @@ local function getClientName() return table.concat({clientName, clientVersion}, ' ') end +local function send(link, msg) + link:write(('s4'):pack(msg)) +end + local function pushClientInfo(link) - link:write(string.pack('zzz' + send(link, string.pack('zzz' , 'pulse' , token , getClientName() @@ -36,7 +40,7 @@ local function pushErrorLog(link) end local err = log.firstError log.firstError = nil - link:write(string.pack('zzzz' + send(link, string.pack('zzzz' , 'error' , token , getClientName() @@ -45,7 +49,7 @@ local function pushErrorLog(link) end timer.wait(5, function () - timer.loop(60, function () + timer.loop(5, function () if not config.config.telemetry.enable then return end @@ -58,5 +62,6 @@ timer.wait(5, function () return end net.update() + log.error('test error') end) end) |