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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
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
nanahira
srvpro
Commits
75cee3b5
Commit
75cee3b5
authored
Feb 05, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into tcg_random
parents
aae57da1
2868ddf1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
24 deletions
+78
-24
data/i18n.json
data/i18n.json
+6
-0
ygopro-server.coffee
ygopro-server.coffee
+33
-11
ygopro-server.js
ygopro-server.js
+39
-13
No files found.
data/i18n.json
View file @
75cee3b5
...
...
@@ -47,6 +47,9 @@
"bad_name_level3"
:
"Your ID contains illegal words."
,
"bad_name_level2"
:
"Your ID contains illegal words."
,
"bad_name_level1"
:
"Your ID contains inappropriate words."
,
"bad_roomname_level3"
:
"Your room name contains illegal words."
,
"bad_roomname_level2"
:
"Your room name contains illegal words."
,
"bad_roomname_level1"
:
"Your room name contains inappropriate words."
,
"invalid_password_room"
:
"Password incorrect"
,
"outdated_client"
:
"You are currently using an outdated client, unknown errors may occur, please update."
,
"watch_join"
:
"joined as spectator."
,
...
...
@@ -386,6 +389,9 @@
"bad_name_level3"
:
"您的用户名存在不适当的内容"
,
"bad_name_level2"
:
"您的用户名存在不适当的内容"
,
"bad_name_level1"
:
"您的用户名存在不适当的内容,请注意更改"
,
"bad_roomname_level3"
:
"您的房间名存在不适当的内容"
,
"bad_roomname_level2"
:
"您的房间名存在不适当的内容"
,
"bad_roomname_level1"
:
"您的房间名存在不适当的内容,请注意更改"
,
"invalid_password_room"
:
"房间密码不正确"
,
"outdated_client"
:
"您的版本号过低,可能出现未知问题,请升级版本"
,
"watch_join"
:
"加入了观战"
,
...
...
ygopro-server.coffee
View file @
75cee3b5
...
...
@@ -2117,9 +2117,31 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
auto_death
:
false
}
options
.
lflist
=
_
.
findIndex
lflists
,
(
list
)
->
((
options
.
rule
==
1
)
==
list
.
tcg
)
and
list
.
date
.
isBefore
()
room_title
=
info
.
pass
.
slice
(
8
).
replace
(
String
.
fromCharCode
(
0xFEFF
),
' '
)
if
_
.
any
(
badwords
.
level3
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
room_title
.
match
(
regexp
)
,
room_title
)
log
.
warn
(
"BAD ROOM NAME LEVEL 3"
,
room_title
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${bad_roomname_level3}"
)
return
else
if
_
.
any
(
badwords
.
level2
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
room_title
.
match
(
regexp
)
,
room_title
)
log
.
warn
(
"BAD ROOM NAME LEVEL 2"
,
room_title
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${bad_roomname_level2}"
)
return
else
if
_
.
any
(
badwords
.
level1
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
room_title
.
match
(
regexp
)
,
room_title
)
log
.
warn
(
"BAD ROOM NAME LEVEL 1"
,
room_title
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${bad_roomname_level1}"
)
return
room
=
new
Room
(
name
,
options
)
if
room
room
.
title
=
info
.
pass
.
slice
(
8
).
replace
(
String
.
fromCharCode
(
0xFEFF
),
' '
)
room
.
title
=
room_title
room
.
private
=
action
==
2
when
3
name
=
info
.
pass
.
slice
(
8
)
...
...
@@ -2359,21 +2381,21 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
log
.
warn
(
"BANNED IP LOGIN"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${banned_ip_login}"
)
else
if
_
.
any
(
badwords
.
level3
,
(
badword
)
->
else
if
!
settings
.
modules
.
tournament_mode
.
enabled
and
!
settings
.
modules
.
challonge
.
enabled
and
_
.
any
(
badwords
.
level3
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
name
.
match
(
regexp
)
,
name
=
client
.
name
)
log
.
warn
(
"BAD NAME LEVEL 3"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${bad_name_level3}"
)
else
if
_
.
any
(
badwords
.
level2
,
(
badword
)
->
else
if
!
settings
.
modules
.
tournament_mode
.
enabled
and
!
settings
.
modules
.
challonge
.
enabled
and
_
.
any
(
badwords
.
level2
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
name
.
match
(
regexp
)
,
name
=
client
.
name
)
log
.
warn
(
"BAD NAME LEVEL 2"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${bad_name_level2}"
)
else
if
_
.
any
(
badwords
.
level1
,
(
badword
)
->
else
if
!
settings
.
modules
.
tournament_mode
.
enabled
and
!
settings
.
modules
.
challonge
.
enabled
and
_
.
any
(
badwords
.
level1
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
name
.
match
(
regexp
)
,
name
=
client
.
name
)
...
...
@@ -3072,6 +3094,12 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server, datas)->
ROOM_players_oppentlist
[
player
.
ip
]
=
null
if
room
.
hostinfo
.
auto_death
ygopro
.
stoc_send_chat_to_room
(
room
,
"${auto_death_part1}
#{
room
.
hostinfo
.
auto_death
}
${auto_death_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
SIDING
and
client
.
pos
<
4
# side deck verified
client
.
selected_preduel
=
true
if
client
.
side_tcount
clearInterval
client
.
side_interval
client
.
side_interval
=
null
client
.
side_tcount
=
null
if
settings
.
modules
.
hide_name
and
room
.
duel_count
==
0
for
player
in
room
.
get_playing_player
()
when
player
!=
client
ygopro
.
stoc_send
(
client
,
'HS_PLAYER_ENTER'
,
{
...
...
@@ -3452,13 +3480,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
buff_side
=
(
info
.
deckbuf
[
i
]
for
i
in
[
info
.
mainc
...
info
.
mainc
+
info
.
sidec
])
client
.
main
=
buff_main
client
.
side
=
buff_side
if
room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
client
.
selected_preduel
=
true
if
client
.
side_tcount
clearInterval
client
.
side_interval
client
.
side_interval
=
null
client
.
side_tcount
=
null
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
client
.
start_deckbuf
=
Buffer
.
from
(
buffer
)
oppo_pos
=
if
room
.
hostinfo
.
mode
==
2
then
2
else
1
if
settings
.
modules
.
http
.
quick_death_rule
>=
2
and
room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
room
.
death
and
room
.
scores
[
room
.
dueling_players
[
0
].
name_vpass
]
!=
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name_vpass
]
...
...
ygopro-server.js
View file @
75cee3b5
...
...
@@ -2649,7 +2649,7 @@
return
(
checksum
&
0xFF
)
===
0
;
};
buffer_handle_callback
=
function
(
buffer
,
decrypted_buffer
,
match_permit
)
{
var
action
,
len2
,
len3
,
len4
,
len5
,
line
,
m
,
n
,
name
,
o
,
opt1
,
opt2
,
opt3
,
options
,
p
,
player
,
ref3
,
ref4
,
ref5
,
ref6
,
room
,
title
;
var
action
,
len2
,
len3
,
len4
,
len5
,
line
,
m
,
n
,
name
,
o
,
opt1
,
opt2
,
opt3
,
options
,
p
,
player
,
ref3
,
ref4
,
ref5
,
ref6
,
room
,
room_title
,
title
;
if
(
client
.
closed
)
{
return
;
}
...
...
@@ -2686,9 +2686,35 @@
options
.
lflist
=
_
.
findIndex
(
lflists
,
function
(
list
)
{
return
((
options
.
rule
===
1
)
===
list
.
tcg
)
&&
list
.
date
.
isBefore
();
});
room_title
=
info
.
pass
.
slice
(
8
).
replace
(
String
.
fromCharCode
(
0xFEFF
),
'
'
);
if
(
_
.
any
(
badwords
.
level3
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
return
room_title
.
match
(
regexp
);
},
room_title
))
{
log
.
warn
(
"
BAD ROOM NAME LEVEL 3
"
,
room_title
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${bad_roomname_level3}
"
);
return
;
}
else
if
(
_
.
any
(
badwords
.
level2
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
return
room_title
.
match
(
regexp
);
},
room_title
))
{
log
.
warn
(
"
BAD ROOM NAME LEVEL 2
"
,
room_title
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${bad_roomname_level2}
"
);
return
;
}
else
if
(
_
.
any
(
badwords
.
level1
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
return
room_title
.
match
(
regexp
);
},
room_title
))
{
log
.
warn
(
"
BAD ROOM NAME LEVEL 1
"
,
room_title
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${bad_roomname_level1}
"
);
return
;
}
room
=
new
Room
(
name
,
options
);
if
(
room
)
{
room
.
title
=
info
.
pass
.
slice
(
8
).
replace
(
String
.
fromCharCode
(
0xFEFF
),
'
'
)
;
room
.
title
=
room_title
;
room
[
"
private
"
]
=
action
===
2
;
}
break
;
...
...
@@ -2993,21 +3019,21 @@
}
else
if
(
_
.
indexOf
(
settings
.
ban
.
banned_ip
,
client
.
ip
)
>
-
1
)
{
log
.
warn
(
"
BANNED IP LOGIN
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${banned_ip_login}
"
);
}
else
if
(
_
.
any
(
badwords
.
level3
,
function
(
badword
)
{
}
else
if
(
!
settings
.
modules
.
tournament_mode
.
enabled
&&
!
settings
.
modules
.
challonge
.
enabled
&&
_
.
any
(
badwords
.
level3
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
return
name
.
match
(
regexp
);
},
name
=
client
.
name
))
{
log
.
warn
(
"
BAD NAME LEVEL 3
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${bad_name_level3}
"
);
}
else
if
(
_
.
any
(
badwords
.
level2
,
function
(
badword
)
{
}
else
if
(
!
settings
.
modules
.
tournament_mode
.
enabled
&&
!
settings
.
modules
.
challonge
.
enabled
&&
_
.
any
(
badwords
.
level2
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
return
name
.
match
(
regexp
);
},
name
=
client
.
name
))
{
log
.
warn
(
"
BAD NAME LEVEL 2
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${bad_name_level2}
"
);
}
else
if
(
_
.
any
(
badwords
.
level1
,
function
(
badword
)
{
}
else
if
(
!
settings
.
modules
.
tournament_mode
.
enabled
&&
!
settings
.
modules
.
challonge
.
enabled
&&
_
.
any
(
badwords
.
level1
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
return
name
.
match
(
regexp
);
...
...
@@ -3961,6 +3987,13 @@
if
(
room
.
hostinfo
.
auto_death
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${auto_death_part1}
"
+
room
.
hostinfo
.
auto_death
+
"
${auto_death_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
}
else
if
(
room
.
duel_stage
===
ygopro
.
constants
.
DUEL_STAGE
.
SIDING
&&
client
.
pos
<
4
)
{
client
.
selected_preduel
=
true
;
if
(
client
.
side_tcount
)
{
clearInterval
(
client
.
side_interval
);
client
.
side_interval
=
null
;
client
.
side_tcount
=
null
;
}
}
if
(
settings
.
modules
.
hide_name
&&
room
.
duel_count
===
0
)
{
ref4
=
room
.
get_playing_player
();
...
...
@@ -4467,14 +4500,7 @@
})();
client
.
main
=
buff_main
;
client
.
side
=
buff_side
;
if
(
room
.
duel_stage
!==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
)
{
client
.
selected_preduel
=
true
;
if
(
client
.
side_tcount
)
{
clearInterval
(
client
.
side_interval
);
client
.
side_interval
=
null
;
client
.
side_tcount
=
null
;
}
}
else
{
if
(
room
.
duel_stage
===
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
)
{
client
.
start_deckbuf
=
Buffer
.
from
(
buffer
);
}
oppo_pos
=
room
.
hostinfo
.
mode
===
2
?
2
:
1
;
...
...
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