Commit 2ccd57ee authored by mercury233's avatar mercury233

update check bad word

parent 0399f41b
......@@ -64,6 +64,7 @@
"ban": {
"banned_user": [],
"banned_ip": [],
"badword_level0": ["滚", "衮", "操", "草", "艹", "狗", "日", "曰", "妈", "娘", "逼"],
"badword_level1": ["傻逼", "垃圾"],
"badword_level2": ["死妈", "草你妈"],
"badword_level3": ["迷奸", "仿真枪"],
......
......@@ -1325,10 +1325,15 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
if oldmsg != msg
log.warn "BAD WORD LEVEL 1", client.name, client.remoteAddress, oldmsg
ygopro.stoc_send_chat(client, "请使用文明用语")
struct = ygopro.structs["chat"]
struct._setBuff(buffer)
struct.set("msg", msg)
buffer = struct.buffer
struct = ygopro.structs["chat"]
struct._setBuff(buffer)
struct.set("msg", msg)
buffer = struct.buffer
else if (_.any(settings.ban.badword_level0, (badword) ->
regexp = new RegExp(badword, 'i')
return msg.match(regexp)
, msg))
log.info "BAD WORD LEVEL 0", client.name, client.remoteAddress, oldmsg
return cancel
ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
......@@ -1373,10 +1378,10 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
struct.set("deckbuf", deckbuf)
buffer = struct.buffer
#log.info("deck ok: " + client.name)
ygopro.stoc_send_chat(client, "成功使用卡组#{found_deck}参加比赛", ygopro.constants.COLORS.BABYBLUE)
ygopro.stoc_send_chat(client, "成功使用卡组 #{found_deck} 参加比赛。", ygopro.constants.COLORS.BABYBLUE)
else
#log.info("bad deck: " + client.name + " / " + buff_main + " / " + buff_side)
ygopro.stoc_send_chat(client, "#{client.name},您的卡组与报名卡组不符。注意卡组不能有包括卡片顺序在内的任何修改。", ygopro.constants.COLORS.RED)
ygopro.stoc_send_chat(client, "您的卡组与报名卡组 #{found_deck} 不符。注意卡组不能有包括卡片顺序在内的任何修改。", ygopro.constants.COLORS.RED)
else
#log.info("player deck not found: " + client.name)
ygopro.stoc_send_chat(client, "#{client.name},没有找到您的报名信息,请确定您使用昵称与报名ID一致。", ygopro.constants.COLORS.RED)
......
......@@ -1642,11 +1642,17 @@
if (oldmsg !== msg) {
log.warn("BAD WORD LEVEL 1", client.name, client.remoteAddress, oldmsg);
ygopro.stoc_send_chat(client, "请使用文明用语");
struct = ygopro.structs["chat"];
struct._setBuff(buffer);
struct.set("msg", msg);
buffer = struct.buffer;
} else if (_.any(settings.ban.badword_level0, function(badword) {
var regexp;
regexp = new RegExp(badword, 'i');
return msg.match(regexp);
}, msg)) {
log.info("BAD WORD LEVEL 0", client.name, client.remoteAddress, oldmsg);
}
struct = ygopro.structs["chat"];
struct._setBuff(buffer);
struct.set("msg", msg);
buffer = struct.buffer;
}
return cancel;
});
......@@ -1717,9 +1723,9 @@
struct.set("sidec", deck_side.length);
struct.set("deckbuf", deckbuf);
buffer = struct.buffer;
ygopro.stoc_send_chat(client, "成功使用卡组" + found_deck + "参加比赛", ygopro.constants.COLORS.BABYBLUE);
ygopro.stoc_send_chat(client, "成功使用卡组 " + found_deck + " 参加比赛。", ygopro.constants.COLORS.BABYBLUE);
} else {
ygopro.stoc_send_chat(client, client.name + ",您的卡组与报名卡组不符。注意卡组不能有包括卡片顺序在内的任何修改。", ygopro.constants.COLORS.RED);
ygopro.stoc_send_chat(client, "您的卡组与报名卡组 " + found_deck + " 不符。注意卡组不能有包括卡片顺序在内的任何修改。", ygopro.constants.COLORS.RED);
}
} else {
ygopro.stoc_send_chat(client, client.name + ",没有找到您的报名信息,请确定您使用昵称与报名ID一致。", ygopro.constants.COLORS.RED);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment