From 9729f4f01b9fe86c1b9c05e96816576db7a37888 Mon Sep 17 00:00:00 2001 From: liuzujun Date: Tue, 14 Sep 2021 11:25:36 +0800 Subject: [PATCH] 修改邮件默认长度,私聊禁言 --- src/actions/GmAction.lua | 2 +- src/actions/RoleAction.lua | 11 +++++++---- src/models/Email.lua | 2 +- src/services/dbseed.lua | 5 ++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index b9838f2..9815b05 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -66,7 +66,7 @@ end function _M.silent(role, pms) local pm1 = tonum(pms.pm1, 0) - dump(pms, pm1) + --dump(pms, pm1) if pm1 < 1 then role:updateProperty({field = "silent", value = 0}) role:setProperty("silentType", 0) diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 0fe6933..b9360d7 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -1282,10 +1282,13 @@ function _M.chatRpc(agent, data) red:rpush(CHAT_OFFLINE:format(objectId), bin) red:ltrim(CHAT_OFFLINE:format(objectId), -200, -1) end) - -- 若在线,实时发送聊天信息 - local agent = datacenter.get("agent", objectId) - if agent then - SendPacket(actionCodes.Role_chat, bin, agent.fd) + + if role:getProperty("silent") < now then --禁言 + -- 若在线,实时发送聊天信息 + local agent = datacenter.get("agent", objectId) + if agent then + SendPacket(actionCodes.Role_chat, bin, agent.fd) + end end end SendPacket(actionCodes.Role_chat, bin) diff --git a/src/models/Email.lua b/src/models/Email.lua index 121981c..dcd7b5f 100644 --- a/src/models/Email.lua +++ b/src/models/Email.lua @@ -10,7 +10,7 @@ Email.schema = { emailId = {"number", 0}, -- 邮件csv ID title = {"string", ""}, -- 邮件标题 stitle = {"string", ""}, -- 小标题 - content = {"string", ""}, -- 邮件正文 + content = {"string", "", 2048}, -- 邮件正文 attachments = {"string", "", 512}, status = {"number", 0}, -- 邮件状态: 未读, 已读, 已领取 createtime = {"number", skynet.timex()}, diff --git a/src/services/dbseed.lua b/src/services/dbseed.lua index 4a370f4..354aace 100644 --- a/src/services/dbseed.lua +++ b/src/services/dbseed.lua @@ -266,7 +266,10 @@ local function doUpdateSql() }, [2] = { "ALTER TABLE `Rune` MODIFY COLUMN `refer` bigint;" - } + }, + [3] = { + "ALTER TABLE `Email` MODIFY COLUMN `refer` VARCHAR(2048);" + }, } -- 更新记录表 local res = mysqlproxy:query("SELECT `value` FROM `autoincrement_set` WHERE `key` = 'db_ver';") -- libgit2 0.21.2