Fix server not correctly removing clients (#588)
* Properly remove connection from clients list * Changed misname in onCloseConnection * Update server.js fix --------- Co-authored-by: JSbETms <137791538+JSbETms@users.noreply.github.com> Co-authored-by: extremeheat <extreme@protonmail.ch>
This commit is contained in:
parent
328785d8af
commit
47f342ca95
1 changed files with 4 additions and 6 deletions
|
|
@ -89,12 +89,10 @@ class Server extends EventEmitter {
|
|||
this.emit('connect', player)
|
||||
}
|
||||
|
||||
onCloseConnection = (inetAddr, reason) => {
|
||||
this.conLog('Connection closed: ', inetAddr?.address, reason)
|
||||
|
||||
delete this.clients[inetAddr]?.connection // Prevent close loop
|
||||
this.clients[inetAddr?.address ?? inetAddr]?.close()
|
||||
delete this.clients[inetAddr]
|
||||
onCloseConnection = (conn, reason) => {
|
||||
this.conLog('Connection closed: ', conn.address, reason)
|
||||
this.clients[conn.address]?.close()
|
||||
delete this.clients[conn.address]
|
||||
this.clientCount--
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue