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
224f8da0
Commit
224f8da0
authored
Nov 14, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix node 18 closed problem
parent
747b78c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
ygopro-server.coffee
ygopro-server.coffee
+7
-7
ygopro-server.js
ygopro-server.js
+9
-9
No files found.
ygopro-server.coffee
View file @
224f8da0
...
...
@@ -852,7 +852,7 @@ CLIENT_kick = global.CLIENT_kick = (client) ->
if
!
client
return
false
client
.
system_kicked
=
true
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
c
losed
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
isC
losed
if
client
.
server
and
!
client
.
had_new_reconnection
room
=
ROOM_all
[
client
.
rid
]
if
room
...
...
@@ -1796,8 +1796,8 @@ netRequestHandler = (client) ->
# 释放处理
closeHandler
=
(
error
)
->
#log.info "client closed", client.name, had_error
#
log.info "disconnect", client.ip, ROOM_connected_ip[client.ip]
log
.
info
"client closed"
,
client
.
name
,
error
,
client
.
closed
log
.
info
"disconnect"
,
client
.
ip
,
ROOM_connected_ip
[
client
.
ip
]
if
client
.
closed
return
room
=
ROOM_all
[
client
.
rid
]
...
...
@@ -1810,7 +1810,7 @@ netRequestHandler = (client) ->
CLIENT_heartbeat_unregister
(
client
)
if
room
if
!
CLIENT_reconnect_register
(
client
,
client
.
rid
,
error
)
room
.
disconnect
(
client
)
room
.
disconnect
(
client
,
error
)
else
if
!
client
.
had_new_reconnection
SERVER_kick
(
client
.
server
)
return
...
...
@@ -1818,13 +1818,13 @@ netRequestHandler = (client) ->
if
client
.
isWs
client
.
on
'close'
,
(
code
,
reason
)
->
closeHandler
()
else
client
.
on
'close'
,
(
had_error
)
->
closeHandler
(
had_error
?
'unknown'
:
undefined
)
client
.
on
'timeout'
,
()
->
unless
settings
.
modules
.
reconnect
.
enabled
and
(
disconnect_list
[
CLIENT_get_authorize_key
(
client
)]
or
client
.
had_new_reconnection
)
client
.
destroy
()
return
else
client
.
on
'close'
,
(
had_error
)
->
closeHandler
(
had_error
?
'unknown'
:
undefined
)
client
.
on
'error'
,
closeHandler
...
...
ygopro-server.js
View file @
224f8da0
...
...
@@ -1119,7 +1119,7 @@
return
false
;
}
client
.
system_kicked
=
true
;
if (settings.modules.reconnect.enabled && client.
c
losed) {
if
(
settings
.
modules
.
reconnect
.
enabled
&&
client
.
isC
losed
)
{
if
(
client
.
server
&&
!
client
.
had_new_reconnection
)
{
room
=
ROOM_all
[
client
.
rid
];
if
(
room
)
{
...
...
@@ -2423,8 +2423,8 @@
// 释放处理
closeHandler
=
function
(
error
)
{
var
room
;
//log.info "client closed", client.name, had_error
//log.info "disconnect", client.ip, ROOM_connected_ip[client.ip]
log
.
info
(
"
client closed
"
,
client
.
name
,
error
,
client
.
closed
);
log
.
info
(
"
disconnect
"
,
client
.
ip
,
ROOM_connected_ip
[
client
.
ip
]);
if
(
client
.
closed
)
{
return
;
}
...
...
@@ -2440,7 +2440,7 @@
}
if
(
room
)
{
if
(
!
CLIENT_reconnect_register
(
client
,
client
.
rid
,
error
))
{
room.disconnect(client);
room
.
disconnect
(
client
,
error
);
}
}
else
if
(
!
client
.
had_new_reconnection
)
{
SERVER_kick
(
client
.
server
);
...
...
@@ -2450,17 +2450,17 @@
client
.
on
(
'
close
'
,
function
(
code
,
reason
)
{
return
closeHandler
();
});
client.on('timeout', function() {
if (!(settings.modules.reconnect.enabled && (disconnect_list[CLIENT_get_authorize_key(client)] || client.had_new_reconnection))) {
client.destroy();
}
});
}
else
{
client
.
on
(
'
close
'
,
function
(
had_error
)
{
return
closeHandler
(
had_error
!=
null
?
had_error
:
{
'
unknown
'
:
void
0
});
});
client
.
on
(
'
timeout
'
,
function
()
{
if
(
!
(
settings
.
modules
.
reconnect
.
enabled
&&
(
disconnect_list
[
CLIENT_get_authorize_key
(
client
)]
||
client
.
had_new_reconnection
)))
{
client
.
destroy
();
}
});
}
client
.
on
(
'
error
'
,
closeHandler
);
server
.
on
(
'
close
'
,
function
(
had_error
)
{
...
...
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