Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
srvpro
Commits
2ccd57ee
Commit
2ccd57ee
authored
Jul 17, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update check bad word
parent
0399f41b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
config.json
config.json
+1
-0
ygopro-server.coffee
ygopro-server.coffee
+11
-6
ygopro-server.js
ygopro-server.js
+12
-6
No files found.
config.json
View file @
2ccd57ee
...
...
@@ -64,6 +64,7 @@
"ban"
:
{
"banned_user"
:
[],
"banned_ip"
:
[],
"badword_level0"
:
[
"滚"
,
"衮"
,
"操"
,
"草"
,
"艹"
,
"狗"
,
"日"
,
"曰"
,
"妈"
,
"娘"
,
"逼"
],
"badword_level1"
:
[
"傻逼"
,
"垃圾"
],
"badword_level2"
:
[
"死妈"
,
"草你妈"
],
"badword_level3"
:
[
"迷奸"
,
"仿真枪"
],
...
...
ygopro-server.coffee
View file @
2ccd57ee
...
...
@@ -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
)
...
...
ygopro-server.js
View file @
2ccd57ee
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment