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
1bffbd6a
Commit
1bffbd6a
authored
Feb 16, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix death
parent
24047452
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
10 deletions
+31
-10
config.json
config.json
+1
-0
i18n.json
i18n.json
+3
-1
ygopro-server.coffee
ygopro-server.coffee
+13
-5
ygopro-server.js
ygopro-server.js
+14
-4
No files found.
config.json
View file @
1bffbd6a
...
...
@@ -141,6 +141,7 @@
"public_roomlist"
:
false
,
"show_ip"
:
false
,
"show_info"
:
true
,
"quick_death_rule"
:
false
,
"ssl"
:
{
"enabled"
:
false
,
"port"
:
7923
,
...
...
i18n.json
View file @
1bffbd6a
...
...
@@ -185,8 +185,10 @@
"cannot_to_observer"
:
"匹配模式中决斗者不允许观战。"
,
"death_cancel"
:
"已取消本房间的加时赛状态。"
,
"death_start"
:
"加时赛开始,从本回合开始计算4回合,基本分高的玩家获得本次决斗的胜利。"
,
"death_start_siding"
:
"加时赛开始,下次决斗将进入猝死赛,基本分发生变动的回合结束时将决出胜负。"
,
"death_start_siding"
:
"加时赛开始,下次决斗的第4回合结束时,基本分高的玩家决斗胜利。"
,
"death_start_quick"
:
"加时赛开始,下次决斗将进入猝死赛,基本分发生变动的回合结束时将决出胜负。"
,
"death_start_final"
:
"本次决斗将进入猝死赛,基本分发生变动的回合结束时,基本分高的玩家将获得本次决斗的胜利。"
,
"death_start_extra"
:
"本次决斗为额外决斗,第4回合结束时,基本分高的玩家获得本次决斗的胜利。"
,
"death_remain_part1"
:
"本次决斗将在"
,
"death_remain_part2"
:
"回合后结束,基本分高的玩家将获得本次决斗的胜利。"
,
"death_remain_final"
:
"若本回合有双方的基本分发生变动,则回合结束时基本分高的玩家将获得本次决斗的胜利。"
,
...
...
ygopro-server.coffee
View file @
1bffbd6a
...
...
@@ -1252,9 +1252,13 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
room
.
turn
=
0
room
.
dueling
=
true
room
.
duel_count
=
room
.
duel_count
+
1
if
room
.
death
and
room
.
duel_count
>
1
room
.
death
=
-
1
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_final}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
room
.
death
if
settings
.
modules
.
http
.
quick_death_rule
and
room
.
duel_count
>
1
room
.
death
=
-
1
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_final}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
room
.
death
=
5
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_extra}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
#ygopro.stoc_send_chat_to_room(room, "LP跟踪调试信息: #{client.name} 初始LP #{client.lp}")
...
...
@@ -1267,6 +1271,7 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_finish_part1}"
+
(
if
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
1
].
lp
then
room
.
dueling_players
[
0
]
else
room
.
dueling_players
[
1
]).
name
+
"${death_finish_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
ctos_send
((
if
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
1
].
lp
then
room
.
dueling_players
[
1
]
else
room
.
dueling_players
[
0
]).
server
,
'SURRENDER'
)
else
room
.
death
=
-
1
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_remain_final}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_remain_part1}"
+
(
room
.
death
-
room
.
turn
)
+
"${death_remain_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
...
...
@@ -2040,9 +2045,12 @@ if settings.modules.http
if
room
.
dueling
or
!
room
.
duel_count
room
.
death
=
(
if
room
.
turn
then
room
.
turn
+
4
else
5
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
else
room
.
death
=
-
1
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_siding}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
settings
.
modules
.
http
.
quick_death_rule
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_quick}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_siding}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
response
.
writeHead
(
200
)
if
death_room_found
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['death ok', '"
+
u
.
query
.
death
+
"']"
))
...
...
ygopro-server.js
View file @
1bffbd6a
...
...
@@ -1497,9 +1497,14 @@
room
.
turn
=
0
;
room
.
dueling
=
true
;
room
.
duel_count
=
room
.
duel_count
+
1
;
if
(
room
.
death
&&
room
.
duel_count
>
1
)
{
room
.
death
=
-
1
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_final}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
if
(
room
.
death
)
{
if
(
settings
.
modules
.
http
.
quick_death_rule
&&
room
.
duel_count
>
1
)
{
room
.
death
=
-
1
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_final}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
room
.
death
=
5
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_extra}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
}
}
}
...
...
@@ -1512,6 +1517,7 @@
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_finish_part1}
"
+
(
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
1
].
lp
?
room
.
dueling_players
[
0
]
:
room
.
dueling_players
[
1
]).
name
+
"
${death_finish_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
ctos_send
((
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
1
].
lp
?
room
.
dueling_players
[
1
]
:
room
.
dueling_players
[
0
]).
server
,
'
SURRENDER
'
);
}
else
{
room
.
death
=
-
1
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_remain_final}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
}
else
{
...
...
@@ -2575,7 +2581,11 @@
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
room
.
death
=
-
1
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_siding}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
if
(
settings
.
modules
.
http
.
quick_death_rule
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_quick}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start_siding}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
}
}
response
.
writeHead
(
200
);
...
...
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