升级进出消息样式(服务器配合调整)
This commit is contained in:
@@ -91,8 +91,8 @@ return{
|
||||
-- wsDisconnected="WS连接断开",
|
||||
-- wsNoConn="WS未连接",
|
||||
|
||||
-- chatJoin="有人来了,当前人数:",
|
||||
-- chatLeave="有人离开了,当前人数:",
|
||||
-- chatJoin="进入房间",
|
||||
-- chatLeave="离开房间",
|
||||
-- chatRemain="人数:",
|
||||
-- chatHistory="------以上是历史消息------",
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ return{
|
||||
-- wsDisconnected="WS连接断开",
|
||||
-- wsNoConn="WS未连接",
|
||||
|
||||
-- chatJoin="有人来了,当前人数:",
|
||||
-- chatLeave="有人离开了,当前人数:",
|
||||
-- chatJoin="进入房间",
|
||||
-- chatLeave="离开房间",
|
||||
-- chatRemain="人数:",
|
||||
-- chatHistory="------以上是历史消息------",
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ return{
|
||||
-- wsDisconnected="WS连接断开",
|
||||
-- wsNoConn="WS未连接",
|
||||
|
||||
-- chatJoin="有人来了,当前人数:",
|
||||
-- chatLeave="有人离开了,当前人数:",
|
||||
-- chatJoin="进入房间",
|
||||
-- chatLeave="离开房间",
|
||||
-- chatRemain="人数:",
|
||||
-- chatHistory="------以上是历史消息------",
|
||||
|
||||
|
||||
@@ -92,8 +92,8 @@ return{
|
||||
wsDisconnected="WS连接断开",
|
||||
wsNoConn="WS未连接",
|
||||
|
||||
chatJoin="有人来了,当前人数:",
|
||||
chatLeave="有人离开了,当前人数:",
|
||||
chatJoin="进入房间",
|
||||
chatLeave="离开房间",
|
||||
chatRemain="人数:",
|
||||
chatHistory="------以上是历史消息------",
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ function scene.sceneInit()
|
||||
|
||||
scroll=#texts
|
||||
if scroll>0 then
|
||||
if texts[scroll][1]~=COLOR.green then
|
||||
ins(texts,{COLOR.green,text.chatHistory})
|
||||
if texts[scroll][1]~=COLOR.dG then
|
||||
ins(texts,{COLOR.dG,text.chatHistory})
|
||||
scroll=scroll+1
|
||||
end
|
||||
end
|
||||
@@ -76,22 +76,21 @@ function scene.socketRead(mes)
|
||||
local sep=mes:find(":")
|
||||
local cmd=mes:sub(2,sep-1)
|
||||
local data=mes:sub(sep+1)
|
||||
if cmd=="J"then
|
||||
remain=tonumber(data)
|
||||
if remain<=10 then
|
||||
ins(texts,{COLOR.yellow,text.chatJoin..remain})
|
||||
end
|
||||
elseif cmd=="L"then
|
||||
remain=tonumber(data)
|
||||
if remain<=10 then
|
||||
ins(texts,{COLOR.yellow,text.chatLeave..remain})
|
||||
end
|
||||
if cmd=="J"or cmd=="L"then
|
||||
sep=data:find("@")
|
||||
local num=data:find("#")
|
||||
remain=tonumber(data:sub(1,sep-1))
|
||||
ins(texts,{
|
||||
COLOR.lR,data:sub(sep+1,num-1),
|
||||
COLOR.dY,data:sub(num).." ",
|
||||
COLOR.Y,(cmd=="J"and text.chatJoin or text.chatLeave),
|
||||
})
|
||||
end
|
||||
else--user message
|
||||
local sep=mes:find(":")
|
||||
local num=mes:find("#")
|
||||
ins(texts,{
|
||||
COLOR.white,mes:sub(1,num-1),
|
||||
COLOR.W,mes:sub(1,num-1),
|
||||
COLOR.dY,mes:sub(num,sep-1).." ",
|
||||
COLOR.sky,mes:sub(sep+1),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user