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
d8362d7e
Commit
d8362d7e
authored
Feb 24, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add change side time limist
parent
d751d18f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
1 deletion
+51
-1
data/default_config.json
data/default_config.json
+1
-0
data/i18n.json
data/i18n.json
+5
-0
ygopro-server.coffee
ygopro-server.coffee
+20
-0
ygopro-server.js
ygopro-server.js
+25
-1
No files found.
data/default_config.json
View file @
d8362d7e
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
"welcome"
:
"MyCard YGOPro Server"
,
"welcome"
:
"MyCard YGOPro Server"
,
"update"
:
"请更新游戏版本"
,
"update"
:
"请更新游戏版本"
,
"stop"
:
false
,
"stop"
:
false
,
"side_timeout"
:
3
,
"i18n"
:
{
"i18n"
:
{
"auto_pick"
:
false
,
"auto_pick"
:
false
,
"default"
:
"zh-cn"
,
"default"
:
"zh-cn"
,
...
...
data/i18n.json
View file @
d8362d7e
...
@@ -207,6 +207,11 @@
...
@@ -207,6 +207,11 @@
"death_remain_final"
:
"若本回合基本分发生变动,在该回合结束时决斗即告结束,生命值多的玩家获得本场决斗的胜利。"
,
"death_remain_final"
:
"若本回合基本分发生变动,在该回合结束时决斗即告结束,生命值多的玩家获得本场决斗的胜利。"
,
"death_finish_part1"
:
"加时赛决斗结束,恭喜 "
,
"death_finish_part1"
:
"加时赛决斗结束,恭喜 "
,
"death_finish_part2"
:
" 获得本次决斗的胜利。"
,
"death_finish_part2"
:
" 获得本次决斗的胜利。"
,
"side_timeout_part1"
:
"你现在有"
,
"side_timeout_part2"
:
"分钟来更换副卡组。"
,
"side_overtime"
:
"更换副卡组超时,本次比赛判负。"
,
"side_remain_part1"
:
"更换副卡组时间还剩"
,
"side_remain_part2"
:
"分钟。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
},
"ko-kr"
:
{
"ko-kr"
:
{
...
...
ygopro-server.coffee
View file @
d8362d7e
...
@@ -1790,6 +1790,10 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
...
@@ -1790,6 +1790,10 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
buff_side
=
(
info
.
deckbuf
[
i
]
for
i
in
[
info
.
mainc
...
info
.
mainc
+
info
.
sidec
])
buff_side
=
(
info
.
deckbuf
[
i
]
for
i
in
[
info
.
mainc
...
info
.
mainc
+
info
.
sidec
])
client
.
main
=
buff_main
client
.
main
=
buff_main
client
.
side
=
buff_side
client
.
side
=
buff_side
if
client
.
side_tcount
clearInterval
client
.
side_interval
client
.
side_interval
=
null
client
.
side_tcount
=
null
if
room
.
random_type
or
room
.
arena
if
room
.
random_type
or
room
.
arena
if
client
.
pos
==
0
if
client
.
pos
==
0
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
waiting_for_player
=
room
.
waiting_for_player2
...
@@ -1878,6 +1882,22 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)->
...
@@ -1878,6 +1882,22 @@ ygopro.stoc_follow 'CHANGE_SIDE', false, (buffer, info, client, server)->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
return
unless
room
room
.
changing_side
=
true
room
.
changing_side
=
true
if
settings
.
modules
.
side_timeout
client
.
side_tcount
=
settings
.
modules
.
side_timeout
ygopro
.
stoc_send_chat
(
client
,
"${side_timeout_part1}
#{
settings
.
modules
.
side_timeout
}
${side_timeout_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
sinterval
=
setInterval
()
->
if
not
(
room
and
room
.
started
and
client
and
client
.
side_tcount
and
room
.
changing_side
)
clearInterval
sinterval
return
if
client
.
side_tcount
==
1
ygopro
.
stoc_send_chat
(
client
,
"${side_overtime}"
,
ygopro
.
constants
.
COLORS
.
RED
)
client
.
destroy
()
clearInterval
sinterval
else
client
.
side_tcount
=
client
.
side_tcount
-
1
ygopro
.
stoc_send_chat
(
client
,
"${side_remain_part1}
#{
settings
.
modules
.
side_timeout
}
${side_remain_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
,
60000
client
.
side_interval
=
sinterval
if
room
.
random_type
or
room
.
arena
if
room
.
random_type
or
room
.
arena
if
client
.
pos
==
0
if
client
.
pos
==
0
room
.
waiting_for_player
=
client
room
.
waiting_for_player
=
client
...
...
ygopro-server.js
View file @
d8362d7e
...
@@ -2234,6 +2234,11 @@
...
@@ -2234,6 +2234,11 @@
})();
})();
client
.
main
=
buff_main
;
client
.
main
=
buff_main
;
client
.
side
=
buff_side
;
client
.
side
=
buff_side
;
if
(
client
.
side_tcount
)
{
clearInterval
(
client
.
side_interval
);
client
.
side_interval
=
null
;
client
.
side_tcount
=
null
;
}
if
(
room
.
random_type
||
room
.
arena
)
{
if
(
room
.
random_type
||
room
.
arena
)
{
if
(
client
.
pos
===
0
)
{
if
(
client
.
pos
===
0
)
{
room
.
waiting_for_player
=
room
.
waiting_for_player2
;
room
.
waiting_for_player
=
room
.
waiting_for_player2
;
...
@@ -2350,12 +2355,31 @@
...
@@ -2350,12 +2355,31 @@
});
});
ygopro
.
stoc_follow
(
'
CHANGE_SIDE
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
ygopro
.
stoc_follow
(
'
CHANGE_SIDE
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
var
room
;
var
room
,
sinterval
;
room
=
ROOM_all
[
client
.
rid
];
room
=
ROOM_all
[
client
.
rid
];
if
(
!
room
)
{
if
(
!
room
)
{
return
;
return
;
}
}
room
.
changing_side
=
true
;
room
.
changing_side
=
true
;
if
(
settings
.
modules
.
side_timeout
)
{
client
.
side_tcount
=
settings
.
modules
.
side_timeout
;
ygopro
.
stoc_send_chat
(
client
,
"
${side_timeout_part1}
"
+
settings
.
modules
.
side_timeout
+
"
${side_timeout_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
sinterval
=
setInterval
(
function
()
{
if
(
!
(
room
&&
room
.
started
&&
client
&&
client
.
side_tcount
&&
room
.
changing_side
))
{
clearInterval
(
sinterval
);
return
;
}
if
(
client
.
side_tcount
===
1
)
{
ygopro
.
stoc_send_chat
(
client
,
"
${side_overtime}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
client
.
destroy
();
return
clearInterval
(
sinterval
);
}
else
{
client
.
side_tcount
=
client
.
side_tcount
-
1
;
return
ygopro
.
stoc_send_chat
(
client
,
"
${side_remain_part1}
"
+
settings
.
modules
.
side_timeout
+
"
${side_remain_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
},
60000
);
client
.
side_interval
=
sinterval
;
}
if
(
room
.
random_type
||
room
.
arena
)
{
if
(
room
.
random_type
||
room
.
arena
)
{
if
(
client
.
pos
===
0
)
{
if
(
client
.
pos
===
0
)
{
room
.
waiting_for_player
=
client
;
room
.
waiting_for_player
=
client
;
...
...
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