diff --git a/cvm-rs/index.d.ts b/cvm-rs/index.d.ts index 6032ed6..9e664f2 100644 --- a/cvm-rs/index.d.ts +++ b/cvm-rs/index.d.ts @@ -80,5 +80,5 @@ js side api: remotingMouseEvent(client, x, y, buttons) - mouse event on the rust side a boxed client will contain an inner boxed `dyn RemotingProtocolClient` which will contain protocol specific dispatch, - upon parsing a remoting URI we will create a given client (e.g, for `vnc://` we'd make the VNC one) + upon parsing a remoting URI we will create a given client (e.g: for `vnc://` we'd make the VNC one) */ diff --git a/cvmts/src/CollabVMServer.ts b/cvmts/src/CollabVMServer.ts index 4e5f21f..12f220f 100644 --- a/cvmts/src/CollabVMServer.ts +++ b/cvmts/src/CollabVMServer.ts @@ -170,9 +170,6 @@ export default class CollabVMServer { this.sendVoteUpdate(); } - // Unreference the IP data. - user.IP.Unref(); - if (this.indefiniteTurn === user) this.indefiniteTurn = null; this.clients.splice(clientIndex, 1); diff --git a/cvmts/src/IPData.ts b/cvmts/src/IPData.ts index 676b9e8..9de8fdd 100644 --- a/cvmts/src/IPData.ts +++ b/cvmts/src/IPData.ts @@ -16,7 +16,7 @@ export class IPData { // Call when a connection is closed to "release" the ip data Unref() { if (this.refCount - 1 < 0) this.refCount = 0; - this.refCount--; + else this.refCount--; } } @@ -64,7 +64,7 @@ export class IPDataManager { setInterval(() => { for (let tuple of IPDataManager.ipDatas) { if (tuple[1].refCount == 0) { - IPDataManager.logger.Info('Deleted ipdata for IP {0}', tuple[0]); + IPDataManager.logger.Info('Deleted IPData for IP {0}', tuple[0]); IPDataManager.ipDatas.delete(tuple[0]); } }