Commit 5837149410bb76c094d0f7c395f6110b0ede8749

Authored by 熊润斐
2 parents 003806dc 2f7891b4

Merge branch 'bugFix' into tr/publish

* bugFix:
  运营需要
  屏蔽字 优化
src/actions/RoleAction.lua
... ... @@ -160,6 +160,7 @@ function _M.loginRpc( agent, data )
160 160 local resetMode = role:updateTimeReset(now)
161 161 if not resetMode or not resetMode["CrossDay"] then -- 没有跨天
162 162 role.activity:checkActivityStatus(now, false, false)
  163 + role:log("onLogin")
163 164 end
164 165  
165 166 redisproxy:zadd(FRIEND_RECOMMEND, now, roleId)
... ... @@ -291,7 +292,6 @@ function _M.loginRpc( agent, data )
291 292 role:savePvpHTeam()
292 293  
293 294 local hangPass = role:getProperty("hangPass")
294   - role:log("onLogin")
295 295 role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0})
296 296 if msg.newdevice then
297 297 role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]})
... ...
src/models/RoleTimeReset.lua
... ... @@ -20,6 +20,7 @@ ResetFunc["CrossDay"] = function(self, notify, response, now)
20 20  
21 21 response.dTask = {}
22 22 response.advSup = self:getProperty("advSup")
  23 + self:log("onLogin")
23 24 end
24 25  
25 26 ResetFunc["CrossWeek"] = function(self, notify, response)
... ...
src/services/chated.lua
... ... @@ -5,6 +5,8 @@ local crab = require "crab.c"
5 5 local table_insert = table.insert
6 6 local table_unpack = table.unpack
7 7 local mode, id, dict = ...
  8 +local hideCode = utf8.codepoint("*")
  9 +
8 10  
9 11 local function toutf8(name)
10 12 local t = {}
... ... @@ -14,6 +16,16 @@ local function toutf8(name)
14 16 return t
15 17 end
16 18  
  19 +local function fix(a, b)
  20 + for i, v in pairs(a) do
  21 + if b[i] == hideCode then
  22 + a[i] = hideCode
  23 + end
  24 + end
  25 + return utf8.char(table_unpack(a))
  26 +end
  27 +
  28 +
17 29 if mode == "sub" then
18 30 local CMD = {}
19 31 dict = tonumber(dict)
... ... @@ -23,8 +35,9 @@ if mode == "sub" then
23 35 return false
24 36 end
25 37 local utftb = toutf8(name)
26   - if crab.filter(dict, utftb) then
27   - return false, utf8.char(table_unpack(utftb))
  38 + local utftbU = toutf8(string.upper(name))
  39 + if crab.filter(dict, utftbU) then
  40 + return false, fix(utftb, utftbU)
28 41 end
29 42 return true
30 43 end
... ... @@ -45,7 +58,7 @@ else
45 58  
46 59 local words = {}
47 60 for _, data in ipairs(forbidNames) do
48   - local ok, utftb = pcall(toutf8, data.name)
  61 + local ok, utftb = pcall(toutf8, string.upper(data.name))
49 62 if ok then table.insert(words, utftb) end
50 63 end
51 64 local d = crab.open(words)
... ...
src/services/named.lua
... ... @@ -5,6 +5,8 @@ local crab = require "crab.c"
5 5 local table_insert = table.insert
6 6 local table_unpack = table.unpack
7 7 local mode, id, dict = ...
  8 +local hideCode = utf8.codepoint("*")
  9 +
8 10  
9 11 local function toutf8(name)
10 12 local t = {}
... ... @@ -14,6 +16,16 @@ local function toutf8(name)
14 16 return t
15 17 end
16 18  
  19 +local function fix(a, b)
  20 + for i, v in pairs(a) do
  21 + if b[i] == hideCode then
  22 + a[i] = hideCode
  23 + end
  24 + end
  25 + return utf8.char(table_unpack(a))
  26 +end
  27 +
  28 +
17 29 if mode == "sub" then
18 30 local CMD = {}
19 31 dict = tonumber(dict)
... ... @@ -23,8 +35,9 @@ if mode == "sub" then
23 35 return false
24 36 end
25 37 local utftb = toutf8(name)
26   - if crab.filter(dict, utftb) then
27   - return false, utf8.char(table_unpack(utftb))
  38 + local utftbU = toutf8(string.upper(name))
  39 + if crab.filter(dict, utftbU) then
  40 + return false, fix(utftb, utftbU)
28 41 end
29 42 return true
30 43 end
... ... @@ -45,7 +58,7 @@ else
45 58  
46 59 local words = {}
47 60 for _, data in ipairs(forbidNames) do
48   - local ok, utftb = pcall(toutf8, data.name)
  61 + local ok, utftb = pcall(toutf8, string.upper(data.name))
49 62 if ok then table.insert(words, utftb) end
50 63 end
51 64 local d = crab.open(words)
... ...