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
8e1bfb38
Commit
8e1bfb38
authored
Jul 29, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mobile infinite loop reconnect
parent
bd62cf57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
38 deletions
+41
-38
ygopro-server.coffee
ygopro-server.coffee
+18
-17
ygopro-server.js
ygopro-server.js
+23
-21
No files found.
ygopro-server.coffee
View file @
8e1bfb38
...
@@ -659,7 +659,7 @@ CLIENT_heartbeat_unregister = (client) ->
...
@@ -659,7 +659,7 @@ CLIENT_heartbeat_unregister = (client) ->
return
true
return
true
CLIENT_heartbeat_register
=
(
client
,
send
)
->
CLIENT_heartbeat_register
=
(
client
,
send
)
->
if
!
settings
.
modules
.
heartbeat_detection
.
enabled
or
client
.
closed
or
client
.
is_post_watcher
or
client
.
pre_reconnecting
or
client
.
reconnecting
or
client
.
pos
>
3
or
client
.
heartbeat_protected
if
!
settings
.
modules
.
heartbeat_detection
.
enabled
or
client
.
closed
or
client
.
is_post_watcher
or
client
.
pre_reconnecting
or
client
.
reconnecting
or
client
.
waiting_for_last
or
client
.
pos
>
3
or
client
.
heartbeat_protected
return
false
return
false
if
client
.
heartbeat_timeout
if
client
.
heartbeat_timeout
CLIENT_heartbeat_unregister
(
client
)
CLIENT_heartbeat_unregister
(
client
)
...
@@ -2165,19 +2165,14 @@ ygopro.ctos_follow 'REQUEST_FIELD', true, (buffer, info, client, server)->
...
@@ -2165,19 +2165,14 @@ ygopro.ctos_follow 'REQUEST_FIELD', true, (buffer, info, client, server)->
ygopro
.
stoc_follow
'FIELD_FINISH'
,
true
,
(
buffer
,
info
,
client
,
server
)
->
ygopro
.
stoc_follow
'FIELD_FINISH'
,
true
,
(
buffer
,
info
,
client
,
server
)
->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
return
true
unless
room
and
settings
.
modules
.
reconnect
.
enabled
client
.
reconnecting
=
false
client
.
reconnecting
=
false
if
settings
.
modules
.
heartbeat_detection
.
enabled
if
client
.
time_confirm_required
# client did not send TIME_CONFIRM
client
.
heartbeat_protected
=
true
client
.
waiting_for_last
=
true
if
!
client
.
last_game_msg
else
if
client
.
last_game_msg
and
client
.
last_game_msg_title
!=
'WAITING'
# client sent TIME_CONFIRM
return
true
if
client
.
last_hint_msg
if
client
.
last_game_msg_title
!=
'WAITING'
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_hint_msg
)
setTimeout
(
()
->
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_game_msg
)
if
client
.
last_hint_msg
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_hint_msg
)
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_game_msg
)
return
,
50
)
return
true
return
true
wait_room_start
=
(
room
,
time
)
->
wait_room_start
=
(
room
,
time
)
->
...
@@ -2612,11 +2607,17 @@ ygopro.ctos_follow 'TIME_CONFIRM', false, (buffer, info, client, server)->
...
@@ -2612,11 +2607,17 @@ ygopro.ctos_follow 'TIME_CONFIRM', false, (buffer, info, client, server)->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
return
unless
room
if
settings
.
modules
.
reconnect
.
enabled
if
settings
.
modules
.
reconnect
.
enabled
if
client
.
waiting_for_last
client
.
waiting_for_last
=
false
if
client
.
last_game_msg
and
client
.
last_game_msg_title
!=
'WAITING'
if
client
.
last_hint_msg
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_hint_msg
)
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_game_msg
)
client
.
time_confirm_required
=
false
client
.
time_confirm_required
=
false
return
unless
settings
.
modules
.
heartbeat_detection
.
enabled
if
settings
.
modules
.
heartbeat_detection
.
enabled
client
.
heartbeat_protected
=
false
client
.
heartbeat_protected
=
false
client
.
heartbeat_responsed
=
true
client
.
heartbeat_responsed
=
true
CLIENT_heartbeat_unregister
(
client
)
CLIENT_heartbeat_unregister
(
client
)
return
return
ygopro
.
ctos_follow
'HAND_RESULT'
,
false
,
(
buffer
,
info
,
client
,
server
)
->
ygopro
.
ctos_follow
'HAND_RESULT'
,
false
,
(
buffer
,
info
,
client
,
server
)
->
...
...
ygopro-server.js
View file @
8e1bfb38
...
@@ -845,7 +845,7 @@
...
@@ -845,7 +845,7 @@
};
};
CLIENT_heartbeat_register
=
function
(
client
,
send
)
{
CLIENT_heartbeat_register
=
function
(
client
,
send
)
{
if
(
!
settings
.
modules
.
heartbeat_detection
.
enabled
||
client
.
closed
||
client
.
is_post_watcher
||
client
.
pre_reconnecting
||
client
.
reconnecting
||
client
.
pos
>
3
||
client
.
heartbeat_protected
)
{
if
(
!
settings
.
modules
.
heartbeat_detection
.
enabled
||
client
.
closed
||
client
.
is_post_watcher
||
client
.
pre_reconnecting
||
client
.
reconnecting
||
client
.
waiting_for_last
||
client
.
pos
>
3
||
client
.
heartbeat_protected
)
{
return
false
;
return
false
;
}
}
if
(
client
.
heartbeat_timeout
)
{
if
(
client
.
heartbeat_timeout
)
{
...
@@ -2663,23 +2663,17 @@
...
@@ -2663,23 +2663,17 @@
ygopro
.
stoc_follow
(
'
FIELD_FINISH
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
ygopro
.
stoc_follow
(
'
FIELD_FINISH
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
var
room
;
var
room
;
room
=
ROOM_all
[
client
.
rid
];
room
=
ROOM_all
[
client
.
rid
];
if
(
!
room
)
{
if
(
!
(
room
&&
settings
.
modules
.
reconnect
.
enabled
))
{
return
;
}
client
.
reconnecting
=
false
;
if
(
settings
.
modules
.
heartbeat_detection
.
enabled
)
{
client
.
heartbeat_protected
=
true
;
}
if
(
!
client
.
last_game_msg
)
{
return
true
;
return
true
;
}
}
if
(
client
.
last_game_msg_title
!==
'
WAITING
'
)
{
client
.
reconnecting
=
false
;
setTimeout
(
function
()
{
if
(
client
.
time_confirm_required
)
{
if
(
client
.
last_hint_msg
)
{
client
.
waiting_for_last
=
true
;
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_hint_msg
);
}
else
if
(
client
.
last_game_msg
&&
client
.
last_game_msg_title
!==
'
WAITING
'
)
{
}
if
(
client
.
last_hint_msg
)
{
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_game_msg
);
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_hint_msg
);
},
50
);
}
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_game_msg
);
}
}
return
true
;
return
true
;
});
});
...
@@ -3280,14 +3274,22 @@
...
@@ -3280,14 +3274,22 @@
return
;
return
;
}
}
if
(
settings
.
modules
.
reconnect
.
enabled
)
{
if
(
settings
.
modules
.
reconnect
.
enabled
)
{
if
(
client
.
waiting_for_last
)
{
client
.
waiting_for_last
=
false
;
if
(
client
.
last_game_msg
&&
client
.
last_game_msg_title
!==
'
WAITING
'
)
{
if
(
client
.
last_hint_msg
)
{
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_hint_msg
);
}
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_game_msg
);
}
}
client
.
time_confirm_required
=
false
;
client
.
time_confirm_required
=
false
;
}
}
if
(
!
settings
.
modules
.
heartbeat_detection
.
enabled
)
{
if
(
settings
.
modules
.
heartbeat_detection
.
enabled
)
{
return
;
client
.
heartbeat_protected
=
false
;
client
.
heartbeat_responsed
=
true
;
CLIENT_heartbeat_unregister
(
client
);
}
}
client
.
heartbeat_protected
=
false
;
client
.
heartbeat_responsed
=
true
;
CLIENT_heartbeat_unregister
(
client
);
});
});
ygopro
.
ctos_follow
(
'
HAND_RESULT
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
ygopro
.
ctos_follow
(
'
HAND_RESULT
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
...
...
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