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
e680e145
Commit
e680e145
authored
Aug 10, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize random tag
parent
be53edaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
ygopro-server.coffee
ygopro-server.coffee
+5
-2
ygopro-server.js
ygopro-server.js
+5
-2
No files found.
ygopro-server.coffee
View file @
e680e145
...
...
@@ -197,7 +197,7 @@ ROOM_find_or_create_random = (type, player_ip)->
if
bannedplayer
if
bannedplayer
.
count
>
6
and
moment
()
<
bannedplayer
.
time
return
{
"error"
:
"${random_banned_part1}
#{
bannedplayer
.
reasons
.
join
(
'${random_ban_reason_separator}'
)
}
${random_banned_part2}
#{
moment
(
bannedplayer
.
time
).
fromNow
(
true
)
}
${random_banned_part3}"
}
if
bannedplayer
.
count
>
3
and
moment
()
<
bannedplayer
.
time
and
bannedplayer
.
need_tip
if
bannedplayer
.
count
>
3
and
moment
()
<
bannedplayer
.
time
and
bannedplayer
.
need_tip
and
type
!=
'T'
bannedplayer
.
need_tip
=
false
return
{
"error"
:
"${random_deprecated_part1}
#{
bannedplayer
.
reasons
.
join
(
'${random_ban_reason_separator}'
)
}
${random_deprecated_part2}
#{
moment
(
bannedplayer
.
time
).
fromNow
(
true
)
}
${random_deprecated_part3}"
}
else
if
bannedplayer
.
need_tip
...
...
@@ -212,7 +212,7 @@ ROOM_find_or_create_random = (type, player_ip)->
((
type
==
''
and
room
.
random_type
!=
'T'
)
or
room
.
random_type
==
type
)
and
room
.
get_playing_player
().
length
<
max_player
and
(
room
.
get_host
()
==
null
or
room
.
get_host
().
ip
!=
ROOM_players_oppentlist
[
player_ip
])
and
(
playerbanned
==
room
.
deprecated
)
(
playerbanned
==
room
.
deprecated
or
type
==
'T'
)
if
result
result
.
welcome
=
'${random_duel_enter_room_waiting}'
#log.info 'found room', player_name
...
...
@@ -1396,6 +1396,9 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
room
.
dueling_players
[
player
.
pos
]
=
player
room
.
scores
[
player
.
name
]
=
0
room
.
player_datas
.
push
ip
:
player
.
ip
,
name
:
player
.
name
if
room
.
random_type
==
'T'
# 双打房不记录匹配过
ROOM_players_oppentlist
[
player
.
ip
]
=
null
if
settings
.
modules
.
tips
.
enabled
ygopro
.
stoc_send_random_tip
(
client
)
if
settings
.
modules
.
deck_log
.
enabled
and
client
.
main
and
client
.
main
.
length
and
not
client
.
deck_saved
and
not
room
.
windbot
...
...
ygopro-server.js
View file @
e680e145
...
...
@@ -275,7 +275,7 @@
"
error
"
:
"
${random_banned_part1}
"
+
(
bannedplayer
.
reasons
.
join
(
'
${random_ban_reason_separator}
'
))
+
"
${random_banned_part2}
"
+
(
moment
(
bannedplayer
.
time
).
fromNow
(
true
))
+
"
${random_banned_part3}
"
};
}
if
(
bannedplayer
.
count
>
3
&&
moment
()
<
bannedplayer
.
time
&&
bannedplayer
.
need_tip
)
{
if
(
bannedplayer
.
count
>
3
&&
moment
()
<
bannedplayer
.
time
&&
bannedplayer
.
need_tip
&&
type
!==
'
T
'
)
{
bannedplayer
.
need_tip
=
false
;
return
{
"
error
"
:
"
${random_deprecated_part1}
"
+
(
bannedplayer
.
reasons
.
join
(
'
${random_ban_reason_separator}
'
))
+
"
${random_deprecated_part2}
"
+
(
moment
(
bannedplayer
.
time
).
fromNow
(
true
))
+
"
${random_deprecated_part3}
"
...
...
@@ -292,7 +292,7 @@
max_player
=
type
===
'
T
'
?
4
:
2
;
playerbanned
=
bannedplayer
&&
bannedplayer
.
count
>
3
&&
moment
()
<
bannedplayer
.
time
;
result
=
_
.
find
(
ROOM_all
,
function
(
room
)
{
return
room
&&
room
.
random_type
!==
''
&&
!
room
.
started
&&
((
type
===
''
&&
room
.
random_type
!==
'
T
'
)
||
room
.
random_type
===
type
)
&&
room
.
get_playing_player
().
length
<
max_player
&&
(
room
.
get_host
()
===
null
||
room
.
get_host
().
ip
!==
ROOM_players_oppentlist
[
player_ip
])
&&
(
playerbanned
===
room
.
deprecated
);
return
room
&&
room
.
random_type
!==
''
&&
!
room
.
started
&&
((
type
===
''
&&
room
.
random_type
!==
'
T
'
)
||
room
.
random_type
===
type
)
&&
room
.
get_playing_player
().
length
<
max_player
&&
(
room
.
get_host
()
===
null
||
room
.
get_host
().
ip
!==
ROOM_players_oppentlist
[
player_ip
])
&&
(
playerbanned
===
room
.
deprecated
||
type
===
'
T
'
);
});
if
(
result
)
{
result
.
welcome
=
'
${random_duel_enter_room_waiting}
'
;
...
...
@@ -1709,6 +1709,9 @@
ip
:
player
.
ip
,
name
:
player
.
name
});
if
(
room
.
random_type
===
'
T
'
)
{
ROOM_players_oppentlist
[
player
.
ip
]
=
null
;
}
}
}
if
(
settings
.
modules
.
tips
.
enabled
)
{
...
...
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