diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index db50bf7..caab21f 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -1240,6 +1240,12 @@ function _M.chatRpc(agent, data) return end + local dailyChatTimes = role.dailyData:getProperty("chatTimes") + if dailyChatTimes > (globalCsv.chat_world_day_limit or 15) then + result = 4 + return + end + role._worldChatLimit = role._worldChatLimit or {start = 0, count = 0, canSayt = 0} --第一次开始说话时间 从第一次说话次数 能说话的时间 if now < role._worldChatLimit.canSayt then @@ -1268,6 +1274,8 @@ function _M.chatRpc(agent, data) else mcast_util.pub_world(actionCodes.Role_chat, MsgPack.pack(response)) end + dailyChatTimes = dailyChatTimes + 1 + role.dailyData:updateProperty({field="chatTimes", value=dailyChatTimes}) -- pcall(skynet.send, '.globald', "lua", "sendWorldMsg", role._channelIdx, response) role:mylog("role_action", {desc = "chatWorld", text1 = content}) end, diff --git a/src/models/Daily.lua b/src/models/Daily.lua index 94b8bf8..3ca9934 100644 --- a/src/models/Daily.lua +++ b/src/models/Daily.lua @@ -36,6 +36,8 @@ Daily.schema = { treasureBase = {"number", 0}, -- 资源值 treasureList = {"table", {}}, --挂机图鉴 + + chatTimes = {"number", 0}, --每日发言次数 } function Daily:updateProperty(params) -- libgit2 0.21.2