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
46853f49
Commit
46853f49
authored
Jan 11, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add surrender
parent
611eac0e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
i18n.json
i18n.json
+4
-1
ygopro-server.coffee
ygopro-server.coffee
+16
-0
ygopro-server.js
ygopro-server.js
+20
-0
No files found.
i18n.json
View file @
46853f49
...
...
@@ -165,6 +165,9 @@
"cloud_replay_delay_part1"
:
"本场比赛云录像:"
,
"cloud_replay_delay_part2"
:
"。将于本局结束后可播放。"
,
"afk_warn_part1"
:
"已经很久没有操作了,若继续挂机,将于"
,
"afk_warn_part2"
:
"秒后被请出房间"
"afk_warn_part2"
:
"秒后被请出房间"
,
"surrender_confirm"
:
"确实要投降吗?再次输入 /投降 以确认。"
,
"surrender_canceled"
:
"已取消投降,加油!"
,
"surrender_denied"
:
"为保证双方玩家的游戏体验,随机对战中3回合后才能投降。"
}
}
\ No newline at end of file
ygopro-server.coffee
View file @
46853f49
...
...
@@ -1191,6 +1191,10 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
client
.
lp
=
room
.
hostinfo
.
start_lp
#ygopro.stoc_send_chat_to_room(room, "LP跟踪调试信息: #{client.name} 初始LP #{client.lp}")
if
ygopro
.
constants
.
MSG
[
msg
]
==
'NEW_TURN'
and
client
.
surrend_confirm
client
.
surrend_confirm
=
false
ygopro
.
stoc_send_chat
(
client
,
"${surrender_canceled}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
ygopro
.
constants
.
MSG
[
msg
]
==
'WIN'
and
client
.
is_host
pos
=
buffer
.
readUInt8
(
1
)
...
...
@@ -1378,6 +1382,18 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
room
.
last_active_time
=
moment
()
unless
cancel
or
not
room
.
random_type
cmd
=
msg
.
split
(
' '
)
switch
cmd
[
0
]
when
'/投降'
,
'/surrender'
if
!
room
.
started
or
room
.
hostinfo
.
mode
==
2
return
cancel
if
room
.
random_type
ygopro
.
stoc_send_chat
(
client
,
"${surrender_denied}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
return
cancel
if
client
.
surrend_confirm
ygopro
.
ctos_send
(
client
.
server
,
'SURRENDER'
)
else
ygopro
.
stoc_send_chat
(
client
,
"${surrender_confirm}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
client
.
surrend_confirm
=
true
when
'/help'
ygopro
.
stoc_send_chat
(
client
,
"${chat_order_main}"
)
ygopro
.
stoc_send_chat
(
client
,
"${chat_order_help}"
)
...
...
ygopro-server.js
View file @
46853f49
...
...
@@ -1429,6 +1429,10 @@
client
.
is_first
=
!
(
playertype
&
0xf
);
client
.
lp
=
room
.
hostinfo
.
start_lp
;
}
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
NEW_TURN
'
&&
client
.
surrend_confirm
)
{
client
.
surrend_confirm
=
false
;
ygopro
.
stoc_send_chat
(
client
,
"
${surrender_canceled}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
WIN
'
&&
client
.
is_host
)
{
pos
=
buffer
.
readUInt8
(
1
);
if
(
!
(
client
.
is_first
||
pos
===
2
))
{
...
...
@@ -1696,6 +1700,22 @@
}
cmd
=
msg
.
split
(
'
'
);
switch
(
cmd
[
0
])
{
case
'
/投降
'
:
case
'
/surrender
'
:
if
(
!
room
.
started
||
room
.
hostinfo
.
mode
===
2
)
{
return
cancel
;
}
if
(
room
.
random_type
)
{
ygopro
.
stoc_send_chat
(
client
,
"
${surrender_denied}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
return
cancel
;
}
if
(
client
.
surrend_confirm
)
{
ygopro
.
ctos_send
(
client
.
server
,
'
SURRENDER
'
);
}
else
{
ygopro
.
stoc_send_chat
(
client
,
"
${surrender_confirm}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
client
.
surrend_confirm
=
true
;
}
break
;
case
'
/help
'
:
ygopro
.
stoc_send_chat
(
client
,
"
${chat_order_main}
"
);
ygopro
.
stoc_send_chat
(
client
,
"
${chat_order_help}
"
);
...
...
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