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
43f53052
Commit
43f53052
authored
Jul 31, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unfinished
parent
72179db2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
data/default_config.json
data/default_config.json
+1
-0
data/i18n.json
data/i18n.json
+2
-0
ygopro-server.coffee
ygopro-server.coffee
+18
-10
No files found.
data/default_config.json
View file @
43f53052
...
...
@@ -89,6 +89,7 @@
"reconnect"
:
{
"enabled"
:
true
,
"auto_surrender_after_disconnect"
:
false
,
"allow_kick_reconnect"
:
true
,
"wait_time"
:
60000
},
"heartbeat_detection"
:
{
...
...
data/i18n.json
View file @
43f53052
...
...
@@ -138,6 +138,7 @@
"deck_incorrect_reconnect"
:
"Please pick your previous deck."
,
"reconnect_failed"
:
"Reconnect failed."
,
"reconnecting_to_room"
:
"Reconnecting to server..."
,
"reconnect_kicked"
:
"You are kicked out because you're logined in on other devices."
,
"challonge_user_not_found"
:
"You are not a participant of the tournament."
,
"challonge_match_load_failed"
:
"Failed loading tournament info."
,
"challonge_match_not_found"
:
"Your current match was not found."
,
...
...
@@ -422,6 +423,7 @@
"deck_incorrect_reconnect"
:
"请选择你在本局决斗中使用的卡组。"
,
"reconnect_failed"
:
"重新连接失败。"
,
"reconnecting_to_room"
:
"正在重新连接到服务器……"
,
"reconnect_kicked"
:
"你的账号已经在其他设备登录,你被迫下线。"
,
"challonge_user_not_found"
:
"未找到你的参赛信息。"
,
"challonge_match_load_failed"
:
"读取比赛信息失败。"
,
"challonge_match_not_found"
:
"你没有当前轮次的比赛。"
,
...
...
ygopro-server.coffee
View file @
43f53052
...
...
@@ -549,7 +549,7 @@ CLIENT_is_player = (client, room) ->
break
return
is_player
and
client
.
pos
<=
3
CLIENT_is_able_to_reconnect
=
(
client
)
->
CLIENT_is_able_to_reconnect
=
(
client
,
deckbuf
)
->
unless
settings
.
modules
.
reconnect
.
enabled
return
false
if
client
.
system_kicked
...
...
@@ -561,13 +561,21 @@ CLIENT_is_able_to_reconnect = (client) ->
if
!
room
CLIENT_reconnect_unregister
(
client
)
return
false
# if disconnect_info.old_server.closed
# return false
# current_room = disconnect_info.room
# unless current_room and current_room.started
# return false
# if client.is_post_watcher or !CLIENT_is_player(client, current_room) or (room.windbot and client.is_local)
# return false
if
deckbuf
and
!
_
.
isEqual
(
deckbuf
,
disconnect_info
.
deckbuf
)
return
false
return
true
CLIENT_get_kick_reconnect_target
=
(
client
,
deckbuf
)
->
for
room
in
ROOM_all
when
room
.
started
and
!
room
.
windbot
for
player
in
room
.
get_playing_player
()
when
!
player
.
closed
and
player
.
name
==
client
.
name
and
player
.
pass
==
client
.
pass
and
(
settings
.
modules
.
mycard
.
enabled
or
player
.
ip
==
client
.
ip
)
and
(
!
check_deck
or
player
.
start_deckbuf
==
deckbuf
)
CLIENT_is_able_to_kick_reconnect
=
(
client
)
->
unless
settings
.
modules
.
reconnect
.
enabled
and
settings
.
modules
.
reconnect
.
allow_kick_reconnect
return
false
for
room
in
ROOM_all
[
disconnect_info
.
room_id
]
if
!
room
CLIENT_reconnect_unregister
(
client
)
return
false
return
true
CLIENT_send_pre_reconnect_info
=
(
client
,
room
,
old_client
)
->
...
...
@@ -614,7 +622,7 @@ CLIENT_pre_reconnect = (client) ->
if
!
CLIENT_is_able_to_reconnect
(
client
)
return
dinfo
=
disconnect_list
[
CLIENT_get_authorize_key
(
client
)]
client
.
pre_deckbuf
=
dinfo
.
deckbuf
#
client.pre_deckbuf = dinfo.deckbuf
client
.
pre_reconnecting
=
true
client
.
pos
=
dinfo
.
old_client
.
pos
client
.
setTimeout
(
300000
)
...
...
@@ -2479,7 +2487,7 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
ygopro
.
ctos_follow
'UPDATE_DECK'
,
true
,
(
buffer
,
info
,
client
,
server
)
->
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
pre_reconnecting
if
_
.
isEqual
(
buffer
,
client
.
pre_
deckbuf
)
if
CLIENT_is_able_to_reconnect
(
client
,
deckbuf
)
CLIENT_reconnect
(
client
)
else
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_reconnect}"
,
ygopro
.
constants
.
COLORS
.
RED
)
...
...
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