跑马灯修改提交
parent
e35b64be86
commit
5ffd4eab51
|
@ -76,6 +76,7 @@ function this.TimeUpdate()
|
||||||
this.RefreshMainPanelShowMsg()
|
this.RefreshMainPanelShowMsg()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 聊天界面开启之后开始计时
|
||||||
-- 开始刷新聊天数据
|
-- 开始刷新聊天数据
|
||||||
function this.StartChatDataUpdate()
|
function this.StartChatDataUpdate()
|
||||||
-- 开始定时刷新
|
-- 开始定时刷新
|
||||||
|
@ -85,13 +86,14 @@ function this.StartChatDataUpdate()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--关闭聊天数据刷新
|
--关闭聊天数据刷新
|
||||||
function this.StopChatDataUpdate()
|
function this.StopChatDataUpdate()
|
||||||
-- 关闭定时刷新
|
-- -- 关闭定时刷新
|
||||||
if this._CountDownTimer then
|
-- if this._CountDownTimer then
|
||||||
this._CountDownTimer:Stop()
|
-- this._CountDownTimer:Stop()
|
||||||
this._CountDownTimer = nil
|
-- this._CountDownTimer = nil
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,7 +132,7 @@ function this.InitData(func)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 发送消息
|
-- 聊天界面发送消息
|
||||||
function this.RequestSendChatMsg(channel, content, func)
|
function this.RequestSendChatMsg(channel, content, func)
|
||||||
-- 好友消息不能通过此接口发送
|
-- 好友消息不能通过此接口发送
|
||||||
if CHAT_CHANNEL.FRIEND == channel then return end
|
if CHAT_CHANNEL.FRIEND == channel then return end
|
||||||
|
@ -235,10 +237,9 @@ function this.ChatDataAdapter(channel, data)
|
||||||
local newChat = data.chatInfo[i]
|
local newChat = data.chatInfo[i]
|
||||||
local newMsgId = tonumber(newChat.messageId) -- 新消息的消息号
|
local newMsgId = tonumber(newChat.messageId) -- 新消息的消息号
|
||||||
local msgIdFlag = this.GetMsgIdFlag(channel) -- 获取当前最新消息号
|
local msgIdFlag = this.GetMsgIdFlag(channel) -- 获取当前最新消息号
|
||||||
__DebugLog("--")
|
--__DebugLog("消息内容:"..newChat.msg)
|
||||||
--LogGreen("消息内容:"..newChat.msg)
|
--__DebugLog("消息类型:"..newChat.messageType)
|
||||||
--LogGreen("消息类型:"..newChat.messageType)
|
--__DebugLog("本地最新消息"..msgIdFlag..",新消息的消息号:"..newMsgId)
|
||||||
--LogGreen("本地最新消息"..msgIdFlag..",新消息的消息号:"..newMsgId)
|
|
||||||
local msgStr = string.split(newChat.msg,"|")
|
local msgStr = string.split(newChat.msg,"|")
|
||||||
if channel == CHAT_CHANNEL.SYSTEM then
|
if channel == CHAT_CHANNEL.SYSTEM then
|
||||||
for i = 2, #msgStr do
|
for i = 2, #msgStr do
|
||||||
|
@ -282,13 +283,11 @@ function this.ChatDataAdapter(channel, data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--LogGreen("消息内容:"..newChat.msg)
|
__DebugLog("消息内容:"..newChat.msg)
|
||||||
if msgIdFlag < newMsgId or newMsgId == -1 then
|
if msgIdFlag < newMsgId or newMsgId == -1 then
|
||||||
__DebugLog(Language[10362]..tostring(newMsgId == -1))
|
|
||||||
if newMsgId ~= -1 then -- 消息号为-1表示屏蔽消息,保存数据但不保存消息号,
|
if newMsgId ~= -1 then -- 消息号为-1表示屏蔽消息,保存数据但不保存消息号,
|
||||||
this.SetMsgIdFlag(channel, newMsgId) -- 保存当前消息的消息号,避免下次刷新时还会请求
|
this.SetMsgIdFlag(channel, newMsgId) -- 保存当前消息的消息号,避免下次刷新时还会请求
|
||||||
end
|
end
|
||||||
__DebugLog(Language[10363]..tostring(tonumber(newChat.times) <= this.LoginTimeStamp))
|
|
||||||
if channel ~= CHAT_CHANNEL.SYSTEM or tonumber(newChat.times) > this.LoginTimeStamp then -- 登录时间之前的系统消息都不显示
|
if channel ~= CHAT_CHANNEL.SYSTEM or tonumber(newChat.times) > this.LoginTimeStamp then -- 登录时间之前的系统消息都不显示
|
||||||
if channel ~= CHAT_CHANNEL.SYSTEM or this.IsShowInChatPanel(newChat.messageType) then
|
if channel ~= CHAT_CHANNEL.SYSTEM or this.IsShowInChatPanel(newChat.messageType) then
|
||||||
if not GoodFriendManager.IsInBlackList(newChat.senderId) then -- 判断是否在黑名单中
|
if not GoodFriendManager.IsInBlackList(newChat.senderId) then -- 判断是否在黑名单中
|
||||||
|
@ -300,6 +299,7 @@ function this.ChatDataAdapter(channel, data)
|
||||||
end
|
end
|
||||||
-- 跑马灯数据,保存到跑马灯管理器中
|
-- 跑马灯数据,保存到跑马灯管理器中
|
||||||
if this.IsShowInHorseRace(newChat.messageType) then
|
if this.IsShowInHorseRace(newChat.messageType) then
|
||||||
|
__DebugLog("显示跑马灯:"..newChat.msg)
|
||||||
HorseRaceManager.AddRaceData(newChat)
|
HorseRaceManager.AddRaceData(newChat)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue