From 0645cec207a91187edfdd5b829fcf3c9c3f012b3 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 12 Apr 2021 21:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AF=E8=83=BD=E5=AF=BC?= =?UTF-8?q?=E8=87=B4ws=E5=B0=9D=E8=AF=95=E5=8F=91=E9=80=81=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E6=B6=88=E6=81=AF=E7=84=B6=E5=90=8E=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E5=A4=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/websocket.lua | 4 ++-- parts/net.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Zframework/websocket.lua b/Zframework/websocket.lua index 8e1aad6d..9b67fb92 100644 --- a/Zframework/websocket.lua +++ b/Zframework/websocket.lua @@ -86,9 +86,9 @@ local _send do local mask_key={1,14,5,14} local mask_str=char(unpack(mask_key)) - function _send(opcode,message) + function _send(op,message) --Message type - SOCK:send(char(bor(0x80,opcode))) + SOCK:send(char(bor(0x80,op))) if message then --Length diff --git a/parts/net.lua b/parts/net.lua index e8400471..f156e0ab 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -134,7 +134,7 @@ function NET.register(username,email,password) end end function NET.pong(wsName,message) - WS.send(wsName,message,"pong") + WS.send(wsName,type(message)=="string"and message or"","pong") end function NET.getAccessToken() if NET.lock("access_and_login",10)then