Skip to content

Commit

Permalink
deploy: abdb429
Browse files Browse the repository at this point in the history
  • Loading branch information
Neztore committed May 22, 2024
1 parent 084032b commit cc6cb7b
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions lib_client_onNotification.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h1>lib/client/onNotification.js</h1>
args.jar = { session: args.jar }
}
const session = getSession({ jar: args.jar })
let userNotificationConnection = null;
let userNotificationConnection = null

userNotificationConnection = new signalR.HubConnectionBuilder()
.withUrl('https://realtime-signalr.roblox.com/userhub', {
Expand All @@ -194,40 +194,40 @@ <h1>lib/client/onNotification.js</h1>
Cookie: '.ROBLOSECURITY=' + session + ';'
}
})
.build();
.build()

userNotificationConnection.on('notification', function(name, message) {
notifications.emit('data', name, JSON.parse(message))
})
userNotificationConnection.on('notification', function (name, message) {
notifications.emit('data', name, JSON.parse(message))
})

notifications.on('close', userNotificationConnection.stop)
notifications.on('close', userNotificationConnection.stop)

userNotificationConnection.disconnected = function (err) {
notifications.emit('error', new Error('Connection failed: ' + err.message))
if (retries !== -1) {
if (retries > max) {
notifications.emit('close', new Error('Max retries reached'))
} else {
setTimeout(connect, 5000, retries + 1)
}
userNotificationConnection.disconnected = function (err) {
notifications.emit('error', new Error('Connection failed: ' + err.message))
if (retries !== -1) {
if (retries > max) {
notifications.emit('close', new Error('Max retries reached'))
} else {
setTimeout(connect, 5000, retries + 1)
}
}
}

userNotificationConnection.error = function (err) {
notifications.emit('error', err)
}
userNotificationConnection.error = function (err) {
notifications.emit('error', err)
}

userNotificationConnection.connected = function(connection) {
notifications.emit('connect', connection)
}
userNotificationConnection.connected = function (connection) {
notifications.emit('connect', connection)
}

userNotificationConnection.reconnecting = function () {
setTimeout(connect, 5000, 0)
userNotificationConnection.reconnecting = function () {
setTimeout(connect, 5000, 0)
notifications.emit('error', new Error('Lost connection, reconnecting'))
return true // Abort reconnection
}
}

userNotificationConnection.start()
userNotificationConnection.start()
}
connect(-1)
return notifications
Expand Down

0 comments on commit cc6cb7b

Please sign in to comment.