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
969acf07
Commit
969acf07
authored
Mar 22, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protect quitting after 30 sec
parent
cee56068
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
data/i18n.json
data/i18n.json
+4
-0
ygopro-server.coffee
ygopro-server.coffee
+13
-1
ygopro-server.js
ygopro-server.js
+20
-3
No files found.
data/i18n.json
View file @
969acf07
...
...
@@ -156,6 +156,8 @@
"replay_hint_part1"
:
"Sending the replay of the duel number "
,
"replay_hint_part2"
:
"."
,
"invalid_side_rule"
:
"Illegal cards are contained in your side deck."
,
"arena_wait_hint"
:
"If you opponent does not appear within 25 seconds, you may quit without any penalty."
,
"arena_wait_timeout"
:
"Your opponent did not appear, you may quit without any penalty."
,
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
},
"es-es"
:
{
...
...
@@ -459,6 +461,8 @@
"replay_hint_part1"
:
"正在发送第"
,
"replay_hint_part2"
:
"局决斗的录像。"
,
"invalid_side_rule"
:
"副卡组中包含不允许换入副卡组的卡。"
,
"arena_wait_hint"
:
"若对手在25秒内不进入游戏,您退房时不会进行扣分。"
,
"arena_wait_timeout"
:
"由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
"ko-kr"
:
{
...
...
ygopro-server.coffee
View file @
969acf07
...
...
@@ -70,6 +70,8 @@ import_datas = [
"start_deckbuf"
,
"challonge_info"
,
"ready_trap"
,
"join_time"
,
"arena_quit_free"
,
"replays_sent"
]
...
...
@@ -1286,6 +1288,7 @@ class Room
connect
:
(
client
)
->
@
players
.
push
client
client
.
join_time
=
moment
()
if
@
random_type
client
.
abuse_count
=
0
host_player
=
@
get_host
()
...
...
@@ -1317,7 +1320,7 @@ class Room
client
.
server
.
destroy
()
else
#log.info(client.name, @started, @disconnector, @random_type, @players.length)
if
@
arena
and
!
@
started
and
@
disconnector
!=
'server'
and
!
@
arena_score_handled
if
@
arena
and
!
@
started
and
@
disconnector
!=
'server'
and
!
@
arena_score_handled
and
!
client
.
arena_quit_free
for
player
in
@
players
when
player
.
pos
!=
7
@
scores
[
player
.
name_vpass
]
=
0
if
@
players
.
length
==
2
...
...
@@ -3203,6 +3206,15 @@ if settings.modules.mycard.enabled
CLIENT_kick
(
room
.
waiting_for_player
)
else
if
time_passed
>=
(
settings
.
modules
.
random_duel
.
hang_timeout
-
20
)
and
not
(
time_passed
%
10
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
room
.
waiting_for_player
.
name
}
${afk_warn_part1}
#{
settings
.
modules
.
random_duel
.
hang_timeout
-
time_passed
}
${afk_warn_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
for
room
in
ROOM_all
when
room
and
room
.
arena
and
!
room
.
started
and
room
.
get_playing_player
().
length
<
2
player
=
room
.
get_playing_player
()[
0
]
if
player
and
!
player
.
arena_quit_free
waited_time
=
moment
()
-
player
.
join_time
if
waited_time
>=
30000
ygopro
.
stoc_send_chat
(
player
,
"${arena_wait_timeout}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
player
.
arena_quit_free
=
true
else
if
waited_time
>=
5000
and
waited_time
<
6000
ygopro
.
stoc_send_chat
(
player
,
"${arena_wait_hint}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
return
,
1000
...
...
ygopro-server.js
View file @
969acf07
...
...
@@ -58,7 +58,7 @@
}
});
import_datas
=
[
"
abuse_count
"
,
"
ban_mc
"
,
"
vpass
"
,
"
rag
"
,
"
rid
"
,
"
is_post_watcher
"
,
"
retry_count
"
,
"
name
"
,
"
pass
"
,
"
name_vpass
"
,
"
is_first
"
,
"
lp
"
,
"
card_count
"
,
"
is_host
"
,
"
pos
"
,
"
surrend_confirm
"
,
"
kick_count
"
,
"
deck_saved
"
,
"
main
"
,
"
side
"
,
"
side_interval
"
,
"
side_tcount
"
,
"
selected_preduel
"
,
"
last_game_msg
"
,
"
last_game_msg_title
"
,
"
last_hint_msg
"
,
"
start_deckbuf
"
,
"
challonge_info
"
,
"
ready_trap
"
,
"
replays_sent
"
];
import_datas
=
[
"
abuse_count
"
,
"
ban_mc
"
,
"
vpass
"
,
"
rag
"
,
"
rid
"
,
"
is_post_watcher
"
,
"
retry_count
"
,
"
name
"
,
"
pass
"
,
"
name_vpass
"
,
"
is_first
"
,
"
lp
"
,
"
card_count
"
,
"
is_host
"
,
"
pos
"
,
"
surrend_confirm
"
,
"
kick_count
"
,
"
deck_saved
"
,
"
main
"
,
"
side
"
,
"
side_interval
"
,
"
side_tcount
"
,
"
selected_preduel
"
,
"
last_game_msg
"
,
"
last_game_msg_title
"
,
"
last_hint_msg
"
,
"
start_deckbuf
"
,
"
challonge_info
"
,
"
ready_trap
"
,
"
join_time
"
,
"
arena_quit_free
"
,
"
replays_sent
"
];
merge
=
require
(
'
deepmerge
'
);
...
...
@@ -1671,6 +1671,7 @@
Room
.
prototype
.
connect
=
function
(
client
)
{
var
host_player
;
this
.
players
.
push
(
client
);
client
.
join_time
=
moment
();
if
(
this
.
random_type
)
{
client
.
abuse_count
=
0
;
host_player
=
this
.
get_host
();
...
...
@@ -1711,7 +1712,7 @@
}
client
.
server
.
destroy
();
}
else
{
if
(
this
.
arena
&&
!
this
.
started
&&
this
.
disconnector
!==
'
server
'
&&
!
this
.
arena_score_handled
)
{
if
(
this
.
arena
&&
!
this
.
started
&&
this
.
disconnector
!==
'
server
'
&&
!
this
.
arena_score_handled
&&
!
client
.
arena_quit_free
)
{
ref2
=
this
.
players
;
for
(
m
=
0
,
len2
=
ref2
.
length
;
m
<
len2
;
m
++
)
{
player
=
ref2
[
m
];
...
...
@@ -4091,7 +4092,7 @@
if
(
settings
.
modules
.
mycard
.
enabled
)
{
setInterval
(
function
()
{
var
len2
,
m
,
room
,
time_passed
;
var
len2
,
len3
,
m
,
n
,
player
,
room
,
time_passed
,
waited_time
;
for
(
m
=
0
,
len2
=
ROOM_all
.
length
;
m
<
len2
;
m
++
)
{
room
=
ROOM_all
[
m
];
if
(
!
(
room
&&
room
.
started
&&
room
.
arena
&&
room
.
last_active_time
&&
room
.
waiting_for_player
&&
room
.
get_disconnected_count
()
===
0
))
{
...
...
@@ -4108,6 +4109,22 @@
ygopro
.
stoc_send_chat_to_room
(
room
,
room
.
waiting_for_player
.
name
+
"
${afk_warn_part1}
"
+
(
settings
.
modules
.
random_duel
.
hang_timeout
-
time_passed
)
+
"
${afk_warn_part2}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
}
}
for
(
n
=
0
,
len3
=
ROOM_all
.
length
;
n
<
len3
;
n
++
)
{
room
=
ROOM_all
[
n
];
if
(
!
(
room
&&
room
.
arena
&&
!
room
.
started
&&
room
.
get_playing_player
().
length
<
2
))
{
continue
;
}
player
=
room
.
get_playing_player
()[
0
];
if
(
player
&&
!
player
.
arena_quit_free
)
{
waited_time
=
moment
()
-
player
.
join_time
;
if
(
waited_time
>=
30000
)
{
ygopro
.
stoc_send_chat
(
player
,
"
${arena_wait_timeout}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
player
.
arena_quit_free
=
true
;
}
else
if
(
waited_time
>=
5000
&&
waited_time
<
6000
)
{
ygopro
.
stoc_send_chat
(
player
,
"
${arena_wait_hint}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
}
}
},
1000
);
}
...
...
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