修复聊天室不能发分号
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
|
local data=love.data
|
||||||
|
|
||||||
local textBox=WIDGET.newTextBox{name="texts",x=40,y=50,w=1200,h=430}
|
local textBox=WIDGET.newTextBox{name="texts",x=40,y=50,w=1200,h=430}
|
||||||
local remain--People in chat room
|
local remain--People in chat room
|
||||||
@@ -11,7 +12,7 @@ local function _init()
|
|||||||
end
|
end
|
||||||
local function sendMessage()
|
local function sendMessage()
|
||||||
local W=WIDGET.active.input
|
local W=WIDGET.active.input
|
||||||
if #W.value>0 and wsWrite("T"..W.value)then
|
if #W.value>0 and wsWrite("T"..data.encode("string","base64",W.value))then
|
||||||
W.value=""
|
W.value=""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -75,7 +76,7 @@ function scene.socketRead(mes)
|
|||||||
textBox:push{
|
textBox:push{
|
||||||
COLOR.W,args[1],
|
COLOR.W,args[1],
|
||||||
COLOR.dY,args[2].." ",
|
COLOR.dY,args[2].." ",
|
||||||
COLOR.sky,args[3]
|
data.decode("string","base64",COLOR.sky,args[3])
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LOG.print("Illegal message: "..mes,30,COLOR.green)
|
LOG.print("Illegal message: "..mes,30,COLOR.green)
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ function scene.socketRead(mes)
|
|||||||
textBox:push{
|
textBox:push{
|
||||||
COLOR.W,args[1],
|
COLOR.W,args[1],
|
||||||
COLOR.dY,args[2].." ",
|
COLOR.dY,args[2].." ",
|
||||||
COLOR.sky,args[3]
|
data.decode("string","base64",COLOR.sky,args[3])
|
||||||
}
|
}
|
||||||
elseif cmd=="C"then
|
elseif cmd=="C"then
|
||||||
if tostring(USER.id)~=args[2]then
|
if tostring(USER.id)~=args[2]then
|
||||||
|
|||||||
Reference in New Issue
Block a user